简体   繁体   中英

Rails td cell link with instance variables

I have this link:

<%= link_to "#{x.name}", { :controller => 'pages', :action =>
'berufsschule', :given_user => x.name} , :class => "btn btn-danger" %>

I want it to be a clickable table cell. How can I do this?

You can try this via CSS. Create a class something like this:

a.cell_link {display: block; width: 100%; margin: 2em auto;}

And then add it in to your :class => "btn btn-danger" section; eg :class => "btn btn-danger cell_link .

Not knowing your table or UI needs you may find the margin section un-needed or incorrect.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM