Either or both of these is wrong, since in the end I get a "Can't find
an album without id". There is a complicating issue, too, since if I
change the parameter name, I get "undefined local variable".
Anyone got a quick example of the syntax for what *must* be a very
common and simple task???
Shouldn't this be passed as "find_id"??? I guess I could have this
backward, will test. Maybe I'll also try to log output to a file in the
controller, if rails will allow me to debug that way...
Anyway, really the best thing for me would be an example paralleling the
OP request.
Well, to be honest your first post looks correct by inspection. If you
are just posting the id though you do not necessarily need to
use :with. You can group all the items you want within the :url block.
Also, by saying 'throw', I mean that in your action in the controller
have 'throw params' as the first line and then when you try to access
that action it will output, to the screen, a trace that shows you what
parameters are coming across from the view. Very helpful. You can keep
throwing until you get the correct params coming across and then focus
on fixing or writing your action code.
Hmmm, I seem to be uncovering a more basic layer to my miscomprehension.
Thanks people, I think your input will come in handy, but bear with me
for a minute:
Here's where I got to in trying to debug (just noticed stdout in the
controller is the server stdout, handy). Hence its long winded style:
WHAT THE HECK? I'm new to ruby, this seems an odd feature...I would
guess this is about data types??!!? Both numbers are sourced from an
sqlite INTEGER.
Nope. Your "good practice" is in fact more typing and more literal SQL
for what as far as I can see is no good reason at all. Take advantage
of Rails' syntactic sugar and stick with the first version.