Sunday, November 8, 2009

[Rails] Re: comparing data

2009/11/8 Aljaz Fajmut <rails-mailing-list@andreas-s.net>:
>
> How can you pass array of parameters to GET request?

The same as anything else, eg
if @my_array contains [0,1,2]
<%= link_to 'Compare', :controller => 'compare', :action =>
'do_compare', :ids => @my_array %>

If the values you want to pass come from fields then it just a matter
of setting up the fields correctly. Google should be able to sort you
out, I always have to look it up.

If you are only comparing two records then just pass the ids as two params.

Colin

>
>
> Colin Law wrote:
>> 2009/11/8 Aljaz Fajmut <rails-mailing-list@andreas-s.net>:
>>> controller by post or by url?
>>>
>>> Any tips are highly appreciated.
>>> --
>>
>> If I understand correctly you have records in the db and wish to
>> compare them on demand by the user clicking on a link which goes to a
>> compare controller.  In this case I would pass the id values as
>> parameters of a GET request on the compare controller.  It should not
>> be a POST as it does not cause the data in the db to be changed.  The
>> actual compare operation should be a method of the model whose objects
>> are being compared of course.
>>
>> Colin
>
> --
> Posted via http://www.ruby-forum.com/.
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate