# Render partial

**URL:** <https://www.ruby-forum.com/t/render-partial/137741>\
**Category:** Rails\
**Created:** [May 15, 2008, 10:11pm UTC](https://www.ruby-forum.com/t/render-partial/137741 "2008-05-15T22:11:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![claus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/82dd89/32.png) [@claus](https://www.ruby-forum.com/u/claus)\
**Post date:** [May 15, 2008, 10:11pm UTC](https://www.ruby-forum.com/t/render-partial/137741/1 "2008-05-15T22:11:05Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![claus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/82dd89/32.png) [@claus](https://www.ruby-forum.com/u/claus)\
**Post date:** [May 16, 2008, 12:12am UTC](https://www.ruby-forum.com/t/render-partial/137741/2 "2008-05-16T00:12:26Z")

</div>

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. \<  
removed\_email\_address@domain.invalid\> wrote:

> hat da jemand ansÃ¤tze/strategien/lÃ¶sungen parat?
> 
> ## danke!
> 
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> >

–  
Ryan B.

> **[frozenplague.net](http://www.frozenplague.net)**
>
> This domain may be for sale!

Feel free to add me to MSN and/or GTalk as this email.

---

<div class="post-metadata">

**Author:** ![claus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/82dd89/32.png) [@claus](https://www.ruby-forum.com/u/claus)\
**Post date:** [May 16, 2008, 12:25am UTC](https://www.ruby-forum.com/t/render-partial/137741/3 "2008-05-16T00:25:18Z")

</div>

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 🙂  
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.

---

<div class="post-metadata">

**Author:** ![claus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/82dd89/32.png) [@claus](https://www.ruby-forum.com/u/claus)\
**Post date:** [May 16, 2008, 8:33pm UTC](https://www.ruby-forum.com/t/render-partial/137741/4 "2008-05-16T20:33:03Z")

</div>

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. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![claus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/82dd89/32.png) [@claus](https://www.ruby-forum.com/u/claus)\
**Post date:** [May 16, 2008, 8:38pm UTC](https://www.ruby-forum.com/t/render-partial/137741/5 "2008-05-16T20:38:42Z")

</div>

wow!

nice option, thanx. that really brings me forward!
