On 2014-May-22, at 15:39 , Colin Law <clan...@gmail.com> wrote:

> On 22 May 2014 18:17, Fab Forestier <li...@ruby-forum.com> wrote:
>> Colin Law wrote in post #1146811:
>>> On 22 May 2014 16:00, Fab Forestier <li...@ruby-forum.com> wrote:
>>> 
>>> You said that, for example, the link should take you to the edit page
>>> of an article.  How does the user know what article that is?
>>> 
>>> Colin
>> 
>> No by exemple I understand the action of the button but it's a totally
>> different think my button has to redirect to an Operation view but it is
>> not an edit view it's a view created by me, and this operation has to be
>> the operation in the same line in the table with the button.
> 
> You don't redirect to a view using a link or button, you request an
> action in a controller, it is important to use the right words or we
> will all be confused.  It must be particularly difficult when one is
> not working in one's native language, I understand that.
> 
> So, when the button is clicked you need to request an action in a
> controller, and from that you can then show whatever view you like.
> So do you know what action you wish to invoke?
> 
> Colin

Fab,
You seem to have put several concepts into one description of the "problem".

Perhaps if you break it into its parts like:

* The link/button initiates a request back to the server
  ( link_to("Text", my_view_path(article), remote: true) )

* The config/routes.rb specifies how a request is directed to a particular 
controller/action

* The action can use the params from the request to determine what to render or 
where to redirect.

Does that help you either understand the problem or at least indicate which 
part you really have a question about?

-Rob

-- 
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/0F374511-AA05-4577-B74B-6A17F93A975C%40agileconsultingllc.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to