Hi, If a user doesn''t have javascript enabled, how would I know with the link_to_remote... In my view, I have this: <%= link_to_remote( "Add user",:url => { :action => :show_add_user } ) %> And in my action, I have this: def show_add_user if(reqest.xhr?) render :update do |rjs| rjs.replace_html :add_user_form, :partial => ''form'' end else redirect_to_index("<font color=''red''>Error</font>") end But obviously this won''t work since the link_to_remote involves javascript already. What can I do? 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 -~----------~----~----~----~------~----~------~--~---
On Jul 13, 10:15 pm, Justin To <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > But obviously this won''t work since the link_to_remote involves > javascript already. What can I do?Set the href on the link to what the user should see (instead of the default which is just ''#'') Fred> > 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung wrote:> On Jul 13, 10:15�pm, Justin To <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > wrote: >> >> But obviously this won''t work since the link_to_remote involves >> javascript already. What can I do? > > Set the href on the link to what the user should see (instead of the > default which is just ''#'') > > FredMmm... well how do I invoke an action with the link_to_remote when the user has javascript disabled. If I have an action called "add_user", would I still put this in the href, and how? 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 14 Jul 2008, at 01:25, Justin To wrote:> > Frederick Cheung wrote: >> On Jul 13, 10:15�pm, Justin To <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> >> wrote: >>> >>> But obviously this won''t work since the link_to_remote involves >>> javascript already. What can I do? >> >> Set the href on the link to what the user should see (instead of the >> default which is just ''#'') >> >> Fred > > Mmm... well how do I invoke an action with the link_to_remote when the > user has javascript disabled. > > If I have an action called "add_user", would I still put this in the > href, and how?You set the href attribute to the appropriate url (use url_for) Fred> > > 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---