Javascript disabled for link_to_remote

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(“Error”)
end

But obviously this won’t work since the link_to_remote involves
javascript already. What can I do?

Thanks

On Jul 13, 10:15 pm, Justin To [email protected]
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

On 14 Jul 2008, at 01:25, Justin To wrote:

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

Frederick C. wrote:

On Jul 13, 10:15�pm, Justin To [email protected]
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?

Thanks