[Rails] Re: Destructive behavior with link_to, button_to, :post=>tru

Jake Janovetz jakejanovetz at yahoo.com
Sun Jan 22 20:33:40 GMT 2006


Kevin Olbrich wrote:
> Jake Janovetz wrote:
>> Kevin Olbrich wrote:
>>> Jake Janovetz wrote:
>>>> link_to with the :post=>true? 
>>> 
>>> This works pretty well
>>> 
>>> _Kevin
>> 
>> 
>> Great.  Now, to add to the question a bit -- what if I have a selection 
>> of those contacts and want to relay which one was selected to the 
>> link_to w/post?
>> 
>> Do I need to add a Javascript thing to go fetch that value from the 
>> selection item?  Then add the selected "id" to the link?
>> 
>>    Jake
> 
> link_to {:action=>'action', :id=>object.id}, {:post=>true}
> 
> _Kevin

Yes, but the problem is that the data I'd like to send along with the 
link_to action is within form elements.  Using a normal submit/form 
would send this along with the POST, but not the link_to.

I think I'm better off just tweaking my form to suit what is possible 
here.

-- 
Posted via http://www.ruby-forum.com/.


More information about the Rails mailing list