Saturday, 15 June 2013

ruby on rails - haml: how to nest elements within %a tag? -



ruby on rails - haml: how to nest elements within %a tag? -

i wrap event div in %a tag create whole clickable.

this block:

= link_to event_path(event.id) .flipper .event-inner ...

compiles to:

<div class="event-container flip-container" ontouchstart="this.classlist.toggle('hover');"> <a href="/events/21"></a> <div class="flipper"> <a href="/events/21"></a> <div class="event-inner"><a href="/events/21"></a> ...

how unique %a wrapping whole?

watch out indentation in haml :

= link_to(event_path(event.id)) .flipper .event-inner your_code_here

ruby-on-rails tags haml wrap

No comments:

Post a Comment