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
module OrderedSelect | |
extend ActiveSupport::Concern | |
included do | |
def self.ordered_list(ids) | |
ids_list = ids.to_s.split(',').select(&:present?) | |
self.where(id: ids_list).order(ids_list.reverse.map { |id| "#{self.table_name}.id = #{id}" }.join(", ")) | |
end | |
def self.unordered_list(ids) |
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 Reception < ActiveRecord::Base | |
STATES = ['processing', 'refused', 'finished'] | |
belongs_to :user | |
has_many :comments, as: :commentable, dependent: :destroy | |
has_many :reception_items, inverse_of: :reception, dependent: :destroy | |
accepts_nested_attributes_for :reception_items | |
# TODO: remove this when reception form will be finished | |
attr_accessor :name |
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 DesignersController < ApplicationController | |
include PublicHelper | |
include SizeChange | |
load_and_authorize_resource | |
before_action :load_size | |
def index | |
@designers = @designers.main.visible.includes(:favorites).order('LOWER(title) ASC') | |
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
$screen-xs-min: 480px; // Tiny screen / phone | |
$screen-sm-min: 768px; // Small screen / tablet | |
$screen-md-min: 992px; // Medium screen / desktop | |
$screen-lg-min: 1200px; // Large screen / wide desktop | |
// So media queries don't overlap when required, provide a maximum | |
$screen-xs-max: ($screen-sm-min - 1); | |
$screen-sm-max: ($screen-md-min - 1); | |
$screen-md-max: ($screen-lg-min - 1); |
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
CSS: | |
1) css3 arrow http://cssarrowplease.com/ |
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
$("html, body").animate({ scrollTop: %%% }); |
NewerOlder