How can I make a <tr> clickable, to invoke an action? Thanks! -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Not sure to understand what you mean but something like <tr><%link_to "your_link" ... %></tr> On Jul 13, 11:29 pm, Justin To <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> How can I make a <tr> clickable, to invoke an action? > > Thanks! > -- > Posted viahttp://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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Tranquiliste wrote:> Not sure to understand what you mean but something like <tr><%> link_to "your_link" ... %></tr> > > On Jul 13, 11:29 pm, Justin To <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org><tr onclick="location.href=''<%= %>''" > I want the actual row to be clickable... but how do I invoke an action when on the onclick?? Thanks -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Justin To wrote:> Tranquiliste wrote: >> Not sure to understand what you mean but something like <tr><%>> link_to "your_link" ... %></tr> >> >> On Jul 13, 11:29 pm, Justin To <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > > <tr onclick="location.href=''<%= %>''" > > > I want the actual row to be clickable... but how do I invoke an action > when on the onclick?? > > ThanksI need something like this: <tr onclick="invoke controller action"> Thanks -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Justin To wrote:> Justin To wrote: >> Tranquiliste wrote: >>> Not sure to understand what you mean but something like <tr><%>>> link_to "your_link" ... %></tr> >>> >>> On Jul 13, 11:29 pm, Justin To <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> >> >> <tr onclick="location.href=''<%= %>''" > >> >> I want the actual row to be clickable... but how do I invoke an action >> when on the onclick?? >> >> Thanks > > I need something like this: <tr onclick="invoke controller action"> > > ThanksThis should work : <tr onclick="<%= remote_function :url=>{:action=>:my_action} %>"> -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
how obtrusive :P On Jul 14, 6:12 am, nico Itkin <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Justin To wrote: > > Justin To wrote: > >> Tranquiliste wrote: > >>> Not sure to understand what you mean but something like <tr><%> >>> link_to "your_link" ... %></tr> > > >>> On Jul 13, 11:29 pm, Justin To <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > > >> <tr onclick="location.href=''<%= %>''" > > > >> I want the actual row to be clickable... but how do I invoke an action > >> when on the onclick?? > > >> Thanks > > > I need something like this: <tr onclick="invoke controller action"> > > > Thanks > > This should work : > > <tr onclick="<%= remote_function :url=>{:action=>:my_action} %>"> > -- > Posted viahttp://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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org 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 -~----------~----~----~----~------~----~------~--~---
nico Itkin wrote:> This should work : > > <tr onclick="<%= remote_function :url=>{:action=>:my_action} %>">Works great, but now I''m having trouble with the controller. In a partial, I''m trying to replace_html with another partial... So I''ve got this in the first partial: <% for user in @users %> . . . <%= remote_function :url=>{:action=>:show_user_detail, :id => user.email } %> . . . <div id="<%= user.email %>" style="display:none;"> <tr class="row-details"> <td> sdf </td> </tr> </div> This has some problems. Firstly, It still displays ''sdf'' even though I have display:none for the <div>, so what''s wrong with that? In my controller, I have this: def show_user_detail if(request.xhr?) render :update do |rjs| # :params[:id] ??? I''ve no clue if I did that right. rjs.replace_html :params[:id], :partial => ''form'' end else redirect_to_index end end Thanks for the help! -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 14 Jul 2008, at 17:08, Justin To wrote:> > nico Itkin wrote: > >> This should work : >> >> <tr onclick="<%= remote_function :url=>{:action=>:my_action} %>"> > > Works great, but now I''m having trouble with the controller. In a > partial, I''m trying to replace_html with another partial... > > So I''ve got this in the first partial: > <% for user in @users %> > . > . > . > <%= remote_function :url=>{:action=>:show_user_detail, :id => > user.email > } %> > . > . > .> > <div id="<%= user.email %>" style="display:none;">You can''t have a div at the top level of a table like that. (in addition you can''t use characters like @ in dom ids)> render :update do |rjs| > # :params[:id] ??? I''ve no clue if I did that right. > rjs.replace_html :params[:id], :partial => ''form''That should be params[:id] Fred --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---