Skip to content

Instantly share code, notes, and snippets.

@cnruby
Created March 28, 2011 13:09
Show Gist options
  • Select an option

  • Save cnruby/890418 to your computer and use it in GitHub Desktop.

Select an option

Save cnruby/890418 to your computer and use it in GitHub Desktop.
使用Rails框架函数link_to
<!-- 使用jQuery框架(图形按钮) -->
<%= link_to(@blog, :title=>"Show", :class=>"ui-button ui-state-default ui-corner-all") { %>
<span class="ui-icon ui-icon-grip-solid-vertical"></span>
<% } unless @blog.id.nil? %>
<!-- 使用jQuery框架(文字按钮) -->
<%= link_to(blogs_path, :title=>"Listing", :class=>"ui-button ui-state-default ui-corner-all") { %>
Back
<% } %>
<!-- 图形按钮 1 -->
<%= link_to image_tag ("rails.png", :border =>0, :title=>"Show"), :action => :show, :id => @blog %>
<!-- 图形按钮 2 -->
<%= link_to(@blog) { %>
<#%= image_tag ("rails.png", :border =>0, :title=>"Show") %>
<% } unless @blog.id.nil? %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment