I have this link here:
<a href="#rating-box" class="login-window">Rate & Commment</a>
and I would like to convert this into rails style, maybe something like:
<%= link_to 'Rate & Comment', :anchor => "rating-box", :class => "login-window"%>
Is it possible to do so?
Edit 1
One more question.
When I use
<%= link_to "Rate & Commment", comment_path(:post_id => post.id), :class => "post" %>
I can pass on some data (in this case, the post id) to the controller and i can use the data by referencing to params.
So if the path becomes a div element, like
<%= link_to 'Rate & Comment', "#rating-box", :class => "post" %>
can I still pass on data by bracketing it?
Edit 2
I have tried to do this in my view:
<a href="#rating-box" class="post" data-post_id = '<%= p.id %>'>Rate & Comment</a>
However I couldn't retrieve the data in controller with the code below:
def create
@comment.post_id = params[:post_id]
end