On 22 May 2014 14:09, Fab Forestier <li...@ruby-forum.com> wrote:
> Colin Law wrote in post #1146780:
>>  The first
>> question is whether you need to use a form, do you need to post data,
>> or is each button effectively just a link?
>>
>> Colin
>
> No this table just allow users to show the differents existing
> operations and the if they want to modify it they have to click on the
> button.
>
> So my question is:
>
> I have
> @operations=[operations_with_may_elements_1,operations_with_may_elements_2...]
>
> but on click on one button I want to affect the right operation in my
> second variable:
>
> @operation=@operation[n]
>
> where n correspond to the line of the button and then I can reuse
> @operation in my other view because my two view are both using the same
> controller.
>
> I don't know if I'm really clear?

I think so.  You can use button_to do invoke the action, and pass the
operation number as a parameter or in the url.  If you look at the
docs for button_to and google it to find more examples you will surely
find examples that meet your needs.

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 unsubscribe from this group and stop receiving emails from it, send an 
> email to rubyonrails-talk+unsubscr...@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/rubyonrails-talk/055a783a0ac7abd440b5ab8f3557ec7c%40ruby-forum.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLsMYrVi6ns4VUq180JmPkzv3WTDfuw1N2-VhMLQOtaUrw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to