help with rails render action vs routing
Posted
by Stacia
on Stack Overflow
See other posts from Stack Overflow
or by Stacia
Published on 2009-10-30T00:24:57Z
Indexed on
2010/04/12
18:03 UTC
Read the original article
Hit count: 441
I was using some image cropping example that I found online and now I got confused. There is actually no "crop" method in my controller. Instead (following the guide) I put a
render :action => 'cropping', :layout=> "admin"
In my create method. That renders a page the view called cropping.html.erb
. It works fine but I have no idea how to link or render that page otherwise, like if I wanted to hit a URL directly or press a button to recrop an image. Should I actually create a crop method in my controller and hook it up via routing if I want to be able to do this, or is there a way within my view to link to the same place that renders the cropping action?
Sorry about the confusion :) It doesn't help that the first version of the tutorial did have a cropping method and he removed it!! Any explanation on why one method is better over the other would be great. Thanks!!
© Stack Overflow or respective owner