Commit b044beed by vulehuan

use link_to helper

parent 841bca67
......@@ -13,7 +13,9 @@
</thead>
<tbody>
<% 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
card_items = card_infos[:card_items]
......@@ -36,8 +38,12 @@
<% if can_edit %>
<td>
<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>
<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>
<%= link_to cards_path(product_id: card_item[:product_id], card_action: 'update'), class: 'btn btn-info btn-update-card-quantity' do %>
<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>
</td>
<% end %>
......@@ -57,7 +63,7 @@
<tr>
<td colspan="6">
<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>
</td>
</tr>
......
......@@ -26,7 +26,7 @@
<%= 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 } %>
<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' %>
</div>
<% end %>
......
......@@ -10,7 +10,7 @@
<%= form_tag do %>
<div class="text-center">
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' %>
</div>
<% end %>
......
......@@ -6,14 +6,23 @@
class="sprite-1 corner-right"></span>
</h2>
<div class="block-advertising">
<a href="" class="thumbnail"><img
src="<%= image_path('') %>/images/upload/ads/1.jpg" alt="" /></a> <a href=""
class="thumbnail"><img src="<%= image_path('') %>/images/upload/ads/2.gif" alt="" /></a>
<a href="" class="thumbnail"><img
src="<%= image_path('') %>/images/upload/ads/3.png" alt="" /></a> <a href=""
class="thumbnail"><img src="<%= image_path('') %>/images/upload/ads/4.jpg" alt="" /></a>
<a href="" class="thumbnail"><img
src="<%= image_path('') %>/images/upload/ads/5.jpg" alt="" /></a> <a href=""
class="thumbnail"><img src="<%= image_path('') %>/images/upload/ads/6.jpg" alt="" /></a>
<%= link_to '#', class: 'thumbnail' do %>
<img src="<%= image_path('') %>/images/upload/ads/1.jpg" alt="" />
<% end %>
<%= link_to '#', class: 'thumbnail' do %>
<img src="<%= image_path('') %>/images/upload/ads/2.gif" alt="" />
<% end %>
<%= link_to '#', class: 'thumbnail' do %>
<img src="<%= image_path('') %>/images/upload/ads/3.png" alt="" />
<% 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>
......@@ -2,8 +2,9 @@
<div class="container">
<footer>
<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
href="mailto:info@zigexn.vn">info@zigexn.vn</a><br /> <b>Website</b>:
<a href="http://zigexn.vn">http://http://zigexn.vn.com</a>
Xa Do Thanh, Ward 4 Dist. 3, HCMC, Vietnam <br /> <b>Email</b>:
<%= link_to 'info@zigexn.vn', 'mailto:info@zigexn.vn' %>
<br /> <b>Website</b>:
<%= link_to 'http://http://zigexn.vn.com', 'http://http://zigexn.vn.com' %>
</footer>
</div>
<header>
<div class="row">
<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 class="col-md-10 col-sm-10">
<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>
......@@ -15,9 +19,12 @@
if signed_in?
user = current_user
%>
<a href="<%= cards_path %>" class="btn btn-danger"> <span class="glyphicon glyphicon-shopping-cart"></span> Your cart
</a>
<a data-toggle="dropdown" href="#" class="btn btn-default"><span class="glyphicon glyphicon-list"></span> My actions</a>
<%= link_to cards_path, class: 'btn btn-danger' do %>
<span class="glyphicon glyphicon-shopping-cart"></span> Your cart
<% 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">
<li>
<%= link_to edit_user_path(current_user) do %>
......@@ -47,8 +54,9 @@
<%= link_to signup_path, class: "btn btn-default" do %>
<span class="glyphicon glyphicon-user"></span> Register
<% end %>
<a href="<%= cards_path %>" class="btn btn-danger last"> <span class="glyphicon glyphicon-shopping-cart"></span> Your cart
</a>
<%= link_to cards_path, class: 'btn btn-danger last' do %>
<span class="glyphicon glyphicon-shopping-cart"></span> Your cart
<% end %>
<% end %>
......@@ -58,10 +66,10 @@
</header>
<!-- search -->
<div class="input-group block-search">
<input id="txt-keyword" type="text" class="form-control"
placeholder="Enter keywords" value="<%= params['keyword'] %>"> <span
class="input-group-btn"> <a id="btn-search"
class="btn btn-default" href="<%= url_for(controller: 'products', action: 'search') %>"><span
class="glyphicon glyphicon-search"></span>Search</a>
<input id="txt-keyword" type="text" class="form-control" placeholder="Enter keywords" value="<%= params['keyword'] %>">
<span class="input-group-btn">
<%= link_to url_for( controller: 'products', action: 'search' ), class: 'btn btn-default', id: 'btn-search' do %>
<span class="glyphicon glyphicon-search"></span>Search
<% end %>
</span>
</div>
......@@ -12,7 +12,9 @@
i = 1
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
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