Passing paramters in Rest?

In the old way, you can always pass params like this, right?

<%= link_to “Whatever”,:url => {:action => :new,param1 => :foobar} %>

How would you do this Restfully?

That’s actually the way I first thought of, but it didn’t work it
seems. Scrolling down in the error page reveals all the parameters
passed, and the ones passed through the restful routes don’t show up.

Oh, I found out the reason it was reporting errors. I forgot that it
was nested, so it needed 1 more parameter for the ID and then it
accepted other params. Thanks!

On Sun, Jun 22, 2008 at 2:03 PM, Mike C [email protected] wrote:

In the old way, you can always pass params like this, right?

<%= link_to “Whatever”,:url => {:action => :new,param1 => :foobar} %>

How would you do this Restfully?

Mike,

You can pass various parameters through the your restful routes.

<%= link to( “create a new resource”, resource_path( :id => resource,
:extra_param => foo, :extra_param_2 => bar ) ) %>

Something along those lines should work fine.

Cheers,
Robby


Robby R.
Chief Evangelist, Partner

PLANET ARGON, LLC
design // development // hosting

http://www.robbyonrails.com/
aim: planetargon

+1 503 445 2457
+1 877 55 ARGON [toll free]
+1 815 642 4068 [fax]