This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PagesController < ApplicationController | |
def store | |
@products = Product.all | |
render 'store' | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="product-gallery container"> | |
<div class="col-md-12 main-image"> | |
<%= image_tag(p.product_images.first.src) %> | |
<!-- To be populated with product feature image--> | |
</div> | |
<div class="mini-images col-md-12 col-xs-12"> | |
<% p.product_images.each do |img| %> | |
<div class="col-md-4 col-xs-4 mini-image"> | |
<%= link_to(image_tag(img.src), "#") %> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SimplyLightBox.js is provided "AS IS" WITHOUT WARRANTY OF ANY KIND | |
jQuery(document).ready(function($) { | |
var current, size; | |
$('.lightboxX35').click(function(e) { | |
e.preventDefault(); // prevent default click event | |
var image_href = $(this).attr("href"); // grab href from clicked element |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Product < ActiveRecord::Base | |
belongs_to :product_category | |
has_many :product_images | |
has_many :led_configurations | |
has_many :leds, through: :led_configurations | |
include FriendlyId | |
friendly_id :name, :use => [:slugged] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#How should one chain them ? Product > led_config > led | |
@products = Product.all | |
@ledconfig = LedConfiguration.all | |
@leds = Led.all |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% p.led_configurations.map(&:quantity).inject(:+) do |c| %> | |
<%= c.quantity %> | |
<% end %> | |
# outputs 200 300 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I18n::Backend::Simple.send(:include, I18n::Backend::Fallbacks); I18n.fallbacks[:fe] = [:en] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PagesController < ApplicationController | |
def store | |
@products = Product.all | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% @sections.each do |s| %> | |
<tr> | |
<td><%= s.header %></td> | |
<td><%= truncate(sanitize(s.content), length: 80) %> | |
</td> | |
<td><%= link_to "edit", edit_admin_section_path(s) %></td> | |
</tr> | |
<% end %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1><%= @download %></h1> | |
<%= link_to "download", download_path(:ydit => "SB8-YY2DyHI") %> | |
<ul> | |
<% @mp3s.each do |m| %> | |
<li><%= m %></li> | |
<% end %> | |
</ul> |
OlderNewer