With regard to button_to, on first (and quick) inspection, I see that
you
are missing your first argument, name.
Your button_to:
<%= button_to blockrelationships_path, class: ‘btn btn-default btn-xs’,
params: {
blocker_callsign: @callsign,
blocked_callsign: blockedcallsign
},
remote: true do %>
<% end %>
I usually get an error message like this when I am missing arguments in
button_to.
The button_to prototype in Rails 4 is:
(button_to (ActionView::Helpers::UrlHelper) - APIdock)
button_to(name = nil, options = nil, html_options = nil, &block)
name is what appears on the button, usually string like “Delete”, “New”,
etc.
Next, I am assuming that blockrelationships_path is your url path,
controller/action/(:id)… something defined in your router?
I see that you are using a block in ‘do’? Doesn’t seem that you need it.
Do you have content for the block?
I would try first to rewrite your button_to as: (Not sure about brackets
surrounding your params)
<%= button_to (“Button Face Name String”, blockrelationships_path, {
class:
‘btn btn-default btn-xs’,
params: {
blocker_callsign: @callsign,
blocked_callsign: blockedcallsign
}, remote: true } ) %>
If you need the block then I would try rewrite:
<%= button_to [“Button Face Name String”, blockrelationships_path, {
class:
‘btn btn-default btn-xs’,
params: {
blocker_callsign: @callsign,
blocked_callsign: blockedcallsign
}, remote: true }] do %>
<% end %>
I do not offer this latter suggestion confidentially as I could find
very
little on-line documentation regarding the use/syntax for button_to with
a
block.
I am also concerned by:
<%= render partial: ‘shared/block’, locals: { blockedcallsign:
post.callsign } %> … It is apparent how you are using
blockedcallsign
in your ‘shared/block’ partial, are you sure that post.callsign is valid
always? Then I see @callsign? What is @callsign? Is it valid? Is it
related to post.callsign? Not sure about Rails 4, but in params have
two
keys with the same name, yet different values.
Hope this helps…
Liz