# Button position

**URL:** <https://www.ruby-forum.com/t/button-position/134038>\
**Category:** Rails\
**Created:** [April 7, 2008, 7:56am UTC](https://www.ruby-forum.com/t/button-position/134038 "2008-04-07T07:56:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![karthikragu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/a88e57/32.png) [@karthikragu](https://www.ruby-forum.com/u/karthikragu)\
**Post date:** [April 7, 2008, 7:56am UTC](https://www.ruby-forum.com/t/button-position/134038/1 "2008-04-07T07:56:33Z")

</div>

hi all,

```
      im having a form and a back button like this in my view page

```

like this

\<% form\_tag %\>

\<% submit\_tag %\>

\<% end %\> \<% button\_link,‘back’ %\>

but in view page the button\_link is coming always down to submit\_tag  
like

submit

back

but i want to show like

submit back.

somebody please help me for this.

---

<div class="post-metadata">

**Author:** ![karthikragu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/a88e57/32.png) [@karthikragu](https://www.ruby-forum.com/u/karthikragu)\
**Post date:** [April 7, 2008, 10:35am UTC](https://www.ruby-forum.com/t/button-position/134038/2 "2008-04-07T10:35:24Z")

</div>

Not sure if this is your problem but it’s worth a try. When you embed  
rails code between \<%= and %\> it finishes with a newline in the html.  
You could try using \<%= and -%\>. This may not be your problem, however.

---

<div class="post-metadata">

**Author:** ![karthikragu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/a88e57/32.png) [@karthikragu](https://www.ruby-forum.com/u/karthikragu)\
**Post date:** [April 7, 2008, 10:54am UTC](https://www.ruby-forum.com/t/button-position/134038/3 "2008-04-07T10:54:19Z")

</div>

The tag (ie positioned at \<% end %\>) will mean that your  
buttons cannot be together.

Put the end after the button link.

Julian.

Learn Ruby on Rails! Check out the FREE VIDS (for a limited time)  
VIDEO #3 out TODAY!  
[http://sensei.zenunit.com/](http://sensei.zenunit.com/)

---

<div class="post-metadata">

**Author:** ![karthikragu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/a88e57/32.png) [@karthikragu](https://www.ruby-forum.com/u/karthikragu)\
**Post date:** [April 7, 2008, 2:41pm UTC](https://www.ruby-forum.com/t/button-position/134038/4 "2008-04-07T14:41:14Z")

</div>

Julian L. wrote:

> The tag (ie positioned at \<% end %\>) will mean that your  
> buttons cannot be together.
> 
> Put the end after the button link.
> 
> Julian.
> 
> Learn Ruby on Rails! Check out the FREE VIDS (for a limited time)  
> VIDEO #3 out TODAY!  
> [http://sensei.zenunit.com/](http://sensei.zenunit.com/)

hi julian,

```
        i did as u said but when i clicked the back button then also 

```

the form was posted.do u have any other idea.

---

<div class="post-metadata">

**Author:** ![karthikragu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/a88e57/32.png) [@karthikragu](https://www.ruby-forum.com/u/karthikragu)\
**Post date:** [April 7, 2008, 2:39pm UTC](https://www.ruby-forum.com/t/button-position/134038/5 "2008-04-07T14:39:59Z")

</div>

hi john,

```
         i did as u said but it made no difference.do u have any 

```

other idea

---

<div class="post-metadata">

**Author:** ![karthikragu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/a88e57/32.png) [@karthikragu](https://www.ruby-forum.com/u/karthikragu)\
**Post date:** [April 7, 2008, 8:03pm UTC](https://www.ruby-forum.com/t/button-position/134038/6 "2008-04-07T20:03:32Z")

</div>

Karthikragunath B. wrote:

> but in view page the button\_link is coming always down to submit\_tag  
> like
> 
> submit
> 
> back
> 
> but i want to show like
> 
> submit back.

In general, use HTML for the content, but CSS for controlling appearance  
and tuning layout.

A “display: inline” may work, or else enclose the form and button in a  
div and use positioning inside that.

If you want to design web pages which do exactly what you want in the  
way you want, CSS is your friend.
