Commit b044beed by vulehuan

use link_to helper

parent 841bca67
...@@ -13,7 +13,9 @@ ...@@ -13,7 +13,9 @@
</thead> </thead>
<tbody> <tbody>
<% if card_infos.empty? || card_infos[:card_items].empty? %> <% if card_infos.empty? || card_infos[:card_items].empty? %>
<tr><td colspan="6"><a href="<%= products_path %>">Click here to order</a></td></tr> <tr><td colspan="6">
<%= link_to 'Click here to order', products_path %>
</td></tr>
<% <%
else else
card_items = card_infos[:card_items] card_items = card_infos[:card_items]
...@@ -36,8 +38,12 @@ ...@@ -36,8 +38,12 @@
<% if can_edit %> <% if can_edit %>
<td> <td>
<div class="text-center"> <div class="text-center">
<a href="<%= cards_path %>?product_id=<%= card_item[:product_id] %>&card_action=update" class="btn btn-info btn-update-card-quantity"><span class="glyphicon glyphicon-plus"></span> Update quantity</a> <%= link_to cards_path(product_id: card_item[:product_id], card_action: 'update'), class: 'btn btn-info btn-update-card-quantity' do %>
<a href="<%= cards_path %>?product_id=<%= card_item[:product_id] %>&card_action=remove" class="btn btn-danger" dada="{:confirm=>"Do you want to remove this product?"}"><span class="glyphicon glyphicon-remove"></span> Remove</a> <span class="glyphicon glyphicon-plus"></span> Update quantity
<% end %>
<%= link_to cards_path(product_id: card_item[:product_id], card_action: 'remove'), class: 'btn btn-danger', dada: '{:confirm=>"Do you want to remove this product?"}' do %>
<span class="glyphicon glyphicon-remove"></span> Remove
<% end %>
</div> </div>
</td> </td>
<% end %> <% end %>
...@@ -57,7 +63,7 @@ ...@@ -57,7 +63,7 @@
<tr> <tr>
<td colspan="6"> <td colspan="6">
<div class="text-center"> <div class="text-center">
<a class="btn btn-primary" href="<%= url_for(action: 'checkout') %>">Check out</a> <%= link_to 'Check out', { action: 'checkout' }, class: 'btn btn-primary' %>
</div> </div>
</td> </td>
</tr> </tr>
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<%= text_area_tag :note, params[:note], class: "form-control", rows: 10, cols: 25 %> <%= text_area_tag :note, params[:note], class: "form-control", rows: 10, cols: 25 %>
<%= render partial: 'cards/item_list', locals: { card_infos: @card_infos, can_edit: false } %> <%= render partial: 'cards/item_list', locals: { card_infos: @card_infos, can_edit: false } %>
<div class="text-center"> <div class="text-center">
<a href="<%= cards_path %>" class="btn btn-default">Back</a> <%= link_to 'Back', cards_path, class: 'btn btn-default' %>
<%= submit_tag "Continue", class: 'btn btn-primary btn-submit' %> <%= submit_tag "Continue", class: 'btn btn-primary btn-submit' %>
</div> </div>
<% end %> <% end %>
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<%= form_tag do %> <%= form_tag do %>
<div class="text-center"> <div class="text-center">
The information above The information above
<a href="<%= url_for(action: 'checkout') %>" class="btn btn-default">Incorrect, edit</a> <%= link_to 'Incorrect, edit', { action: 'checkout' }, class: 'btn btn-default' %>
<%= submit_tag "Correct, click here", class: 'btn btn-primary btn-submit' %> <%= submit_tag "Correct, click here", class: 'btn btn-primary btn-submit' %>
</div> </div>
<% end %> <% end %>
......
...@@ -6,14 +6,23 @@ ...@@ -6,14 +6,23 @@
class="sprite-1 corner-right"></span> class="sprite-1 corner-right"></span>
</h2> </h2>
<div class="block-advertising"> <div class="block-advertising">
<a href="" class="thumbnail"><img <%= link_to '#', class: 'thumbnail' do %>
src="<%= image_path('') %>/images/upload/ads/1.jpg" alt="" /></a> <a href="" <img src="<%= image_path('') %>/images/upload/ads/1.jpg" alt="" />
class="thumbnail"><img src="<%= image_path('') %>/images/upload/ads/2.gif" alt="" /></a> <% end %>
<a href="" class="thumbnail"><img <%= link_to '#', class: 'thumbnail' do %>
src="<%= image_path('') %>/images/upload/ads/3.png" alt="" /></a> <a href="" <img src="<%= image_path('') %>/images/upload/ads/2.gif" alt="" />
class="thumbnail"><img src="<%= image_path('') %>/images/upload/ads/4.jpg" alt="" /></a> <% end %>
<a href="" class="thumbnail"><img <%= link_to '#', class: 'thumbnail' do %>
src="<%= image_path('') %>/images/upload/ads/5.jpg" alt="" /></a> <a href="" <img src="<%= image_path('') %>/images/upload/ads/3.png" alt="" />
class="thumbnail"><img src="<%= image_path('') %>/images/upload/ads/6.jpg" alt="" /></a> <% end %>
<%= link_to '#', class: 'thumbnail' do %>
<img src="<%= image_path('') %>/images/upload/ads/4.jpg" alt="" />
<% end %>
<%= link_to '#', class: 'thumbnail' do %>
<img src="<%= image_path('') %>/images/upload/ads/5.jpg" alt="" />
<% end %>
<%= link_to '#', class: 'thumbnail' do %>
<img src="<%= image_path('') %>/images/upload/ads/6.jpg" alt="" />
<% end %>
</div> </div>
</div> </div>
...@@ -2,8 +2,9 @@ ...@@ -2,8 +2,9 @@
<div class="container"> <div class="container">
<footer> <footer>
<b>Venshop - Huan Vu Le</b><br /> <b>Address</b>: 17 No.2 street, Cu <b>Venshop - Huan Vu Le</b><br /> <b>Address</b>: 17 No.2 street, Cu
Xa Do Thanh, Ward 4 Dist. 3, HCMC, Vietnam <br /> <b>Email</b>: <a Xa Do Thanh, Ward 4 Dist. 3, HCMC, Vietnam <br /> <b>Email</b>:
href="mailto:info@zigexn.vn">info@zigexn.vn</a><br /> <b>Website</b>: <%= link_to 'info@zigexn.vn', 'mailto:info@zigexn.vn' %>
<a href="http://zigexn.vn">http://http://zigexn.vn.com</a> <br /> <b>Website</b>:
<%= link_to 'http://http://zigexn.vn.com', 'http://http://zigexn.vn.com' %>
</footer> </footer>
</div> </div>
<header> <header>
<div class="row"> <div class="row">
<div class="col-md-2 col-sm-2"> <div class="col-md-2 col-sm-2">
<h1 class="logo pull-left"><a href="<%= root_path %>">Venshop</a></h1> <h1 class="logo pull-left">
<%= link_to 'Venshop', root_path %>
</h1>
</div> </div>
<div class="col-md-10 col-sm-10"> <div class="col-md-10 col-sm-10">
<div class="banner pull-right"> <div class="banner pull-right">
<a href="<%= root_path %>"><img src="<%= image_path('') %>/images/upload/banner/1.png" class="img-responsive" alt="" /></a> <%= link_to root_path do %>
<img src="<%= image_path('') %>/images/upload/banner/1.png" class="img-responsive" alt="" />
<% end %>
</div> </div>
</div> </div>
</div> </div>
...@@ -15,9 +19,12 @@ ...@@ -15,9 +19,12 @@
if signed_in? if signed_in?
user = current_user user = current_user
%> %>
<a href="<%= cards_path %>" class="btn btn-danger"> <span class="glyphicon glyphicon-shopping-cart"></span> Your cart <%= link_to cards_path, class: 'btn btn-danger' do %>
</a> <span class="glyphicon glyphicon-shopping-cart"></span> Your cart
<a data-toggle="dropdown" href="#" class="btn btn-default"><span class="glyphicon glyphicon-list"></span> My actions</a> <% end %>
<%= link_to '#', class: 'btn btn-default', 'data-toggle' => 'dropdown' do %>
<span class="glyphicon glyphicon-list"></span> My actions
<% end %>
<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"> <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
<li> <li>
<%= link_to edit_user_path(current_user) do %> <%= link_to edit_user_path(current_user) do %>
...@@ -47,8 +54,9 @@ ...@@ -47,8 +54,9 @@
<%= link_to signup_path, class: "btn btn-default" do %> <%= link_to signup_path, class: "btn btn-default" do %>
<span class="glyphicon glyphicon-user"></span> Register <span class="glyphicon glyphicon-user"></span> Register
<% end %> <% end %>
<a href="<%= cards_path %>" class="btn btn-danger last"> <span class="glyphicon glyphicon-shopping-cart"></span> Your cart <%= link_to cards_path, class: 'btn btn-danger last' do %>
</a> <span class="glyphicon glyphicon-shopping-cart"></span> Your cart
<% end %>
<% end %> <% end %>
...@@ -58,10 +66,10 @@ ...@@ -58,10 +66,10 @@
</header> </header>
<!-- search --> <!-- search -->
<div class="input-group block-search"> <div class="input-group block-search">
<input id="txt-keyword" type="text" class="form-control" <input id="txt-keyword" type="text" class="form-control" placeholder="Enter keywords" value="<%= params['keyword'] %>">
placeholder="Enter keywords" value="<%= params['keyword'] %>"> <span <span class="input-group-btn">
class="input-group-btn"> <a id="btn-search" <%= link_to url_for( controller: 'products', action: 'search' ), class: 'btn btn-default', id: 'btn-search' do %>
class="btn btn-default" href="<%= url_for(controller: 'products', action: 'search') %>"><span <span class="glyphicon glyphicon-search"></span>Search
class="glyphicon glyphicon-search"></span>Search</a> <% end %>
</span> </span>
</div> </div>
...@@ -12,7 +12,9 @@ ...@@ -12,7 +12,9 @@
i = 1 i = 1
terms.each do |term| terms.each do |term|
%> %>
<li<%= %Q{ class="last">} if i == n %>><a href="<%= product_category_path(term) %>" title=""><%= term.name %></a></li> <li<%= %Q{ class="last">} if i == n %>>
<%= link_to term.name, product_category_path(term) %>
</li>
<% <%
i += 1 i += 1
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment