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("<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

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

Frederick Cheung wrote:

Frederick Cheung 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