# Loading a partial via AJAX

**URL:** <https://www.ruby-forum.com/t/loading-a-partial-via-ajax/192212>\
**Category:** Rails\
**Created:** [July 26, 2010, 2:35pm UTC](https://www.ruby-forum.com/t/loading-a-partial-via-ajax/192212 "2010-07-26T14:35:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [July 26, 2010, 2:35pm UTC](https://www.ruby-forum.com/t/loading-a-partial-via-ajax/192212/1 "2010-07-26T14:35:43Z")

</div>

Hi

I accept that partials are not intended to be exposed via a URL

However I’d like to load my basic \_form.html.erb partial for my model  
to build basic AJAX form

So one way to do this is to put something like this in the controller:

def basic\_form  
render :partial=\>“form”  
end

… but… is there a cleaner way?

cheers

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [July 27, 2010, 12:39am UTC](https://www.ruby-forum.com/t/loading-a-partial-via-ajax/192212/2 "2010-07-27T00:39:56Z")

</div>

Any ideas folks?

On Jul 26, 10:32 pm, “removed\_email\_address@domain.invalid” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
