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
| <% (@page.children || @page.parent.children).each do |child| %> | |
| <li><%= link_to(child.title,child.url) %> </li> | |
| <% end %> | |
| However @page.children returns an empty array instead of nil so this doesn't work. |
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
| <% if @page.parent %> | |
| <% if @page.parent.title == "Properties" %> | |
| <h1>THISISPROPERTIES</h1> | |
| <% 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
| class BookingInformation | |
| # attr_accessor :property,:children,:adults,:checkin,:checkout | |
| def initialize(property,children,adults,checkin,checkout,lan) | |
| @property = property | |
| @children = children | |
| @adults = adults | |
| @checkin = checkin | |
| @checkout = checkout | |
| @lan = lan |
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
| require 'spreadsheet' | |
| book = Spreadsheet.open 'teams.xls' | |
| sheet = book.worksheet 0 | |
| sheet.each do |row| | |
| team = Team.new | |
| team.name = row[0].strip | |
| team.code = row[1].strip | |
| team.save |
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
| # encoding: UTF-8 | |
| class Checkout | |
| @@current_items = {} | |
| @@stock_items = {} | |
| def initialize(pricing_rules) | |
| # Sets the current_items hash to store the amount/type of items | |
| set_items(pricing_rules) | |
| 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
| I have the following line in a Rails mailer: | |
| :subject => "Promoción Octubre Mes del Control de la Línea en Figurella!" | |
| Notice how the words promocion and linea have accuted letters. I tried using html encoded characters but that didn't solve my problem also the magic string # encoding: utf-8 on top of the mailer class and neither. Any ideas on how can i accomplish this, because the app keeps crashing whenever i try to send an email. | |
| Thank You! |
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 TranslateProperties < ActiveRecord::Migration | |
| def self.up | |
| ::Refinery::Properties.reset_column_information | |
| unless defined?(::Refinery::Properties::Translation) && ::Refinery::Properties.table_exists? | |
| ::Refinery::Properties.create_translation_table!({ | |
| :title => :string, | |
| :location => :string, | |
| :short_description => :text, | |
| :directions => :text, | |
| :amenities => :text, |
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 Property < ActiveRecord::Base | |
| acts_as_indexed :fields => [:title, :rate, :location, :max_occupancy, :bedrooms, :bathrooms, :short_description, :about, :directions, :latitude, :longitude] | |
| attr_accessor :locale | |
| validates :title, :presence => true | |
| has_friendly_id :title, :use_slug => true |
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
| if Rails.env.production? | |
| uri = URI.parse(ENV['REDISTOGO_URL']) | |
| REDIS = Redis.new(:host => uri.host, :port => uri.port, :password => uri.password, :thread_safe => true) | |
| Resque.redis = REDIS | |
| Resque.after_fork = proc { | |
| Resque.redis = Redis::Objects.redis = $redis = REDIS.new( | |
| :host => uri.host, | |
| :port => uri.port, | |
| :password => uri.password, | |
| :thread_safe => true |
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
| - Source | |
| -- has_many :videos | |
| -- belongs_to :publisher | |
| - Publisher | |
| -- has_many :sources | |
| - Video | |
| -- has_and_belongs_to_many :tags | |
| -- belongs_to source |
OlderNewer