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’.
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
Thank you all very much. I’m afraid the problem was me, being a moron. There’s nothing wrong with the code. There was a second forgotten ‘render’ in view.html.erb causing the problem. Sorry. Thank you once again.