Rails link_to with inline styling

前端 未结 8 1629
傲寒
傲寒 2020-12-15 16:30

I must change a link_to tag color without using a CSS class, how can I do? I\'ve tried something such as

<%= link_to item.description, {}, {:style=>\'c         


        
8条回答
  •  不知归路
    2020-12-15 16:46

    This should work with Rails 3

    link_to item.description, :style=> 'color:#FFFFFF;', :class => 'css_class'
    

    With the new syntax in rails 4, it becomes

    link_to item.description, style: 'color:#FFFFFF;', class: 'css_class'
    

提交回复
热议问题