marimaf
marimaf

Reputation: 5410

link_to blank space

I have changed the regular labels for view, edit and delete for background images for the corresponding <td> labels. But now the link don't work because I don't have text to click.

How can I make blank spaces clickable, or is there another approach to this problem?

This is what I got:

...
<td class="view"><%= link_to '', event %></td>
<td class="edit"><%= link_to ' ', edit_event_path(event) %></td>
<td class="delete"><%= link_to ' ', event, :confirm => 'Are you sure?', :method => :delete %></td>

I know a solution is to add the image as image_tag and create a link, but having the images declared in the style.css is much more cleaner and simple to implement.

thanks in advance

Upvotes: 1

Views: 698

Answers (1)

Mischa
Mischa

Reputation: 43298

You can make the link clickable by using CSS. If you set the class for your blank links to:

display: inline-block;
width: 100%;
height: 100%;

they should become clickable.

Upvotes: 3

Related Questions