insert a tag under another one.

26 views
Skip to first unread message

mauro

unread,
Feb 2, 2012, 10:33:49 AM2/2/12
to Haml
Hello.
I have this code
= f.commit_button "Try"
that generates this html:

<input class="btn commit create" name="commit" type="submit"
value="Try" />

I want to insert a tag between the input tags like this:

<input class="btn commit create" name="commit" type="submit"
value="Try" >
<i class="icon-pencil"></i>
</input>

How can I achieve this?

Rhett Sutphin

unread,
Feb 2, 2012, 10:59:22 AM2/2/12
to ha...@googlegroups.com
Hi,

On Feb 2, 2012, at 9:33 AM, mauro wrote:

> Hello.
> I have this code
> = f.commit_button "Try"
> that generates this html:

In this code, the HTML for the input is being generated and returned by `f.commit_button`. If you want to change what that helper returns, you have to change the helper (or configure it differently, etc.). This isn't something haml can help you with.

Rhett

>
> <input class="btn commit create" name="commit" type="submit"
> value="Try" />
>
> I want to insert a tag between the input tags like this:
>
> <input class="btn commit create" name="commit" type="submit"
> value="Try" >
> <i class="icon-pencil"></i>
> </input>
>
> How can I achieve this?
>

> --
> You received this message because you are subscribed to the Google Groups "Haml" group.
> To post to this group, send email to ha...@googlegroups.com.
> To unsubscribe from this group, send email to haml+uns...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/haml?hl=en.
>

Les Nightingill

unread,
Feb 2, 2012, 1:31:46 PM2/2/12
to Haml
%input.btn.commit.create{:name => 'commit', :type => 'submit', :value
=> 'Try'}
%i.icon-pencil/

Mauro

unread,
Feb 3, 2012, 6:22:13 AM2/3/12
to ha...@googlegroups.com
On 2 February 2012 19:31, Les Nightingill <codeh...@comcast.net> wrote:
> %input.btn.commit.create{:name => 'commit', :type => 'submit', :value
> => 'Try'}
>  %i.icon-pencil/

It does not insert the icon inside the button but it insert outside on
the right.

Les Nightingill

unread,
Feb 3, 2012, 11:51:41 AM2/3/12
to Haml
I tried it on http://haml-lang.com/try.html and it inserts the icon
tag between the input opening and closing tags. Aren't you seeing that
in the html? Perhaps your css is causing unexpected results?

On Feb 3, 3:22 am, Mauro <mrsan...@gmail.com> wrote:
Reply all
Reply to author
Forward
0 new messages