<%= link_to “Edit”, :controller=>“new”, :action=>“index”, :edit=>true,
Whenever you see something like this in your code, it should be taken as
a big red flag telling you that you’re probably doing something wrong
(or the hard way).
What’s going to happen in 6 months or a year when you, or someone else,
has to decipher this code to figure out what it’s supposed to do? The
beautiful thing about Ruby on Rails is that, when written properly, the
code can be understood in a glance. At least that’s the goal anyway.
Jeff C. wrote:
On Aug 14, 1:25ï¿½pm, Justin To [email protected]
There’s a limit to how much you can stuff into a GET request.
But you don’t need to send all that data, since it’s all coming from
models anyway. Have your edit action prefill your form based on the
@post data. You just need to send the @post.id, and your controller
can figure it all out from there.
Even better would be to go with a RESTful approach if possible - it
would help clean up the logic even further, I believe.
REST with Rails
Oct 4, 2008