Render partial

hallo!

momentan steht meine seite so, dass ich gewisse dinge mit link_to_remote
auf bedarf nachlade.

was mach ich jetzt, wenn javascript deaktiviert ist?
kann ich das irgend wie mit render partial lösen? kann ich mit rails
prüfen, ob javascript aktiviert/deaktiviert ist und dann dahingehend
alle sachen sofort laden?

hat da jemand ansätze/strategien/lösungen parat?

danke!

Hi, if you type in english people can understand you, and help you,
better.

From what I got from the translation service, Claus here has a
link_to_remote and he wants it to do some funky stuff regarding if the
user
has activated / deactived javascript in the browser.

Claus, I don’t think you can get Rails to check to see if javascript is
enabled upon the request.

imo, it’s silly to not have it enabled on.

On Fri, May 16, 2008 at 5:41 AM, Claus S. <
[email protected]> wrote:

hat da jemand ansätze/strategien/lösungen parat?

danke!

Posted via http://www.ruby-forum.com/.


Ryan B.
http://www.frozenplague.net
Feel free to add me to MSN and/or GTalk as this email.

hi! man thanx i forgot, damn it, to write in english…

i m with u in thinking its silly not to turn it on… but the site has
to be really really really user centered :slight_smile:
and there are loads of poeple dont know how to turn it off or on or
whatever. if its turned off, they arent able to retrieve my content
cause its fetched with ajax.

so my question was:

is it possible to use a normal link with a render_partial or whatever
instead of an ajax link_to_remote…

i HAVE to think about a html fallback, but i DONT HAVE that much
experience in rails …

however: somebody know any strategy to solve such a problem?

thanx.

Yes, Claus, it’s fairly easy to do. link_to_remote actually has an
api of:

link_to_remote link_name, options={}, html_options=nil

What you’ll need to do is put braces around your existing options (to
designate them as a complete hash) and then you can pass :href as an
html option. Something like this:

link_to_remote ‘Claus clause’,
{:url=>potentially_dangerous_path, :method=>:get"},
:href=>potentially_dangerous_path

If js id turned off in the browser then the onclick is skipped and it
will react like an ordinary anchor tag.

Good luck!

On May 15, 6:25 pm, Claus S. [email protected]

wow!

nice option, thanx. that really brings me forward!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs