diff options
| author | mo khan <mo@mokhan.ca> | 2014-01-01 08:57:41 -0700 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2014-01-01 08:57:41 -0700 |
| commit | a14a05ce8806161a40cc2a16b117b632d34c1905 (patch) | |
| tree | 27719576babd84bd58282fbe463e4a2df1b7a0f7 /app/views/tutorials | |
| parent | 1f3f8e04fdcc85487d0e5c6cd64edb490f22d30b (diff) | |
convert a href to link_to
Diffstat (limited to 'app/views/tutorials')
| -rw-r--r-- | app/views/tutorials/_form.html.erb | 2 | ||||
| -rw-r--r-- | app/views/tutorials/index.html.erb | 8 |
2 files changed, 6 insertions, 4 deletions
diff --git a/app/views/tutorials/_form.html.erb b/app/views/tutorials/_form.html.erb index ac727859..57972610 100644 --- a/app/views/tutorials/_form.html.erb +++ b/app/views/tutorials/_form.html.erb @@ -32,7 +32,7 @@ $(function(){ <%= f.hidden_field :description, :class => "input-xlarge, tutorial-description" %> <%= f.hidden_field :image_url %> <button type="submit" class="btn btn-primary">Save</button> - <a href="<%= url_for tutorials_url %>" class="btn">Cancel</a> + <%= link_to "Cancel", tutorials_path, class: 'btn' %> </div> </fieldset> <% end %> diff --git a/app/views/tutorials/index.html.erb b/app/views/tutorials/index.html.erb index 2e419642..08eebcc5 100644 --- a/app/views/tutorials/index.html.erb +++ b/app/views/tutorials/index.html.erb @@ -20,14 +20,16 @@ <div class="thumbnail"> <img src="<%= tutorial.image_url %>" /> <div class="caption"> - <h3><a href="<%= tutorial.url %>" target="_blank"><%= tutorial.heading %></a> <small><%= tutorial.created_at.to_s :foomat %></small></h3> + <h3><%= link_to tutorial.heading, tutorial.url, target: '_blank' %> <small><%= tutorial.created_at.to_s :foomat %></small></h3> <p> <% tutorial.tags.each do |tag| -%> - <a href="<%= url_for tutorial_tag_path(tag.name) %>"><span class="label"><%= tag.name %></span></a> + <%= link_to tutorial_tag_path(tag.name) do %> + <span class="label"><%= tag.name %></span> + <% end %> <% end -%> </p> <p><%= tutorial.description %></p> - <p><a class="btn" href="<%= url_for tutorial %>">View</a></p> + <p><%= link_to "View", tutorial, class: 'btn' %></p> </div> </div> </div> |
