Hi there.
I have a conroller, on which I’m using the send() method to find the
correct property to assign a posted value to. This looks like so:
@charactersheets.send(abl) = v
Where the abl variable is defined earlier, and is a method. And the v
variable is a post value assigned earlier. I used to use a switch-case
to assign the value, and that worked fine, but this should save time,
why does it not work? I get the following error:
SyntaxError in CharactersheetsController#show
/Users/emil/Sites/ror/dnd/app/controllers/charactersheets_controller.rb:501:
syntax error, unexpected '=', expecting kEND
@charactersheets.send(abl) = v
^
RAILS_ROOT: ./script/../config/..
Application Trace | Framework Trace | Full Trace
Request
Parameters: {"name"=>"alexander cavendor"}
Show session dump
Response
Headers: {"cookie"=>[], "Cache-Control"=>"no-cache"}