Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I put a link in the middle of a paragraph with HAML?

How do I create this:

<p>
  I would like to make a <a href="foo.html">link</a> in my Rails app.
</p>

with HAML?

like image 821
Eric the Red Avatar asked Sep 04 '10 20:09

Eric the Red


People also ask

How do you add a link in the middle of a paragraph in HTML?

To make a hyperlink in an HTML page, use the <a> and </a> tags, which are the tags used to define the links. The <a> tag indicates where the hyperlink starts and the </a> tag indicates where it ends. Whatever text gets added inside these tags, will work as a hyperlink.

How to use Haml in rails?

To use Haml with Rails, simply add Haml to your Gemfile and run bundle . If you'd like to replace Rails's ERB-based generators with Haml, add haml-rails to your Gemfile as well.


1 Answers

1.

%p
  I would like to make a
  %a
    link
  in my Rails app.

2.

%p
  I would like to make a <a href="#">link</a> in my Rails app.
like image 192
Daniel O'Hara Avatar answered Oct 24 '22 18:10

Daniel O'Hara