On 28 June 2015 at 15:15, Bazley <1975...@gmail.com> wrote: > Thank you very much for your help. > Sorry, I should have included what's inside the block: it's a glyphicon > block sign. > I've researched the correct format for including a block (example here), and > I think I have it correct below (it works when I use a string such as > 'baz'). But when I use blockedcallsign, it still gives the error undefined > local variable or method `blockedcallsign'. > The full code is below: > > <%= button_to blockrelationships_path( > params: { > blocker_callsign: @character.callsign, > blocked_callsign: blockedcallsign, #'baz' > viewed_callsign: @view_character.callsign > }, > remote: true > ), > class: 'btn btn-default btn-xs' do %> > <span class="glyphicon glyphicon-ban-circle" aria-hidden="true"></span> > <% end %> > > I am completely at a loss. Is it perhaps something to do with calling a > partial inside a partial?
I have had that sort of issue occasionally caused by a non-printable character which has somehow got inserted into the source, try re-typing the line where the parameter is passed and where it used to eliminate that possibility. If not that does it help if you call it with a string, blockedcallsign: "text" Also try using the variable in the partial just as a string rather than inside the button_to function, to prove it is not to do with the context where you are using it. As a final test try changing the parameter name. Not sure why it should help but if nothing else it might give you a clue Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLtzORV8d4ysAi77HDyEmRb%3Dn9%2BAsSCPrLt57uKvnswsPw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.