rapidror
rapidror

Reputation: 141

Haml Hyperlink inside a label tag

Inside my .haml file, I have

= employee.label :tos_confirmation, 'I agree to the Terms of Service.', :class => 'wide'

How do i make Terms of Service a hyperlink?

Upvotes: 1

Views: 2043

Answers (2)

rapidror
rapidror

Reputation: 141

The answer I was looking for is like this:

  %label.wide{:for => "tos_confirmation"}
    I agree to the 
    %a{:href => "/tos"} Terms of Service
    and
    = succeed "." do
      %a{:href => "/privacy_policy"} Privacy Policy

The only part I'm missing is the "employee" part, which is not too important.

Upvotes: 2

Sergio Tulentsev
Sergio Tulentsev

Reputation: 230316

= link_to employee.label(:tos_confirmation, 
                         'I agree to the Terms of Service.', 
                         :class => 'wide'), 
          'http://example.com/tos'

Upvotes: 2

Related Questions