# Nesting elements inside a generate \<a\> tag through link\_to

**URL:** <https://www.ruby-forum.com/t/nesting-elements-inside-a-generate-a-tag-through-link-to/132777>\
**Category:** Rails\
**Created:** [March 24, 2008, 5:24pm UTC](https://www.ruby-forum.com/t/nesting-elements-inside-a-generate-a-tag-through-link-to/132777 "2008-03-24T17:24:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![RoR\_pal\_0001](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/cdc98d/32.png) [@RoR\_pal\_0001](https://www.ruby-forum.com/u/RoR_pal_0001)\
**Post date:** [March 24, 2008, 5:24pm UTC](https://www.ruby-forum.com/t/nesting-elements-inside-a-generate-a-tag-through-link-to/132777/1 "2008-03-24T17:24:21Z")

</div>

Hi all, I’ve just recently started developing on Rails, just this  
month.

I have a simple question that I can’t find the answer to elsewhere;

I’m using the link\_to\_remote directive which generates an anchor tag.  
I’d like to have A whole div section nested within the generated  
anchor tag so that the whole div is clickable rather than just the  
text in the button.

This is how it looks now:

 \<%= link\_to\_remote 'Add', :url =\> { :action =\> 'add', :id =\> section }, :update =\> 'section\_wrapper'%\>

I’d like to get a link to the appropriate action nesting Add

Any help is appreciated

---

<div class="post-metadata">

**Author:** ![RoR\_pal\_0001](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/cdc98d/32.png) [@RoR\_pal\_0001](https://www.ruby-forum.com/u/RoR_pal_0001)\
**Post date:** [March 24, 2008, 5:37pm UTC](https://www.ruby-forum.com/t/nesting-elements-inside-a-generate-a-tag-through-link-to/132777/2 "2008-03-24T17:37:22Z")

</div>

i don’t know exactly what you want, but shouldn’t you set the a-tag  
there to display: block with css?
