I have a large div:
.limeskin:hover {
background: #eee;
cursor: pointer;
display: block;
}
that I want to be clickable. Because I\'m
link_to can accept a block:
<%= link_to root_path do %>
Hey!
<% end %>
This will surround the div with tags.
Documentation: http://apidock.com/rails/ActionView/Helpers/UrlHelper/link_to
Or if you have a big div and want to make it "clickable", using jQuery:
# html.erb
Price:
<%= number_to_currency(post.price, :unit => "R") %>
#[...]
# jQuery.js
$('.limeskin').click( function(event) {
var clicked_div = $(this);
# do stuff with the event object and 'this' which
# represent the element you just clicked on
});