Button_to带有文本和图像轨道3

时间:2013-01-17 13:04:43

标签: ruby-on-rails-3 link-to button-to

如何在Rails3中创建带标签和图像的按钮?

此代码仅显示图像:

<%= link_to image_tag("newRevision.png"), {:controller => :review_transitions, :action => :show_step}, {:class => "navBtn"} %>

但......带有文字的图片?

<%= link_to "example_text"+image_tag("newRevision.png"), {:controller => :review_transitions, :action => :show_step}, {:class => "navBtn"} %>

谢谢!

1 个答案:

答案 0 :(得分:0)

我认为这可能是这些内容

<%= link_to image_tag('image/someimage.png') + "Some text", some_path) %>