This file contains 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
al ejecutar rspec spec/request/posts_pages_spec.rb --format doc | |
/Users/angelito/.rvm/gems/ruby-1.9.3-p194@mysql2/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in `load': cannot load such file -- /Users/angelito/Developement/eternia/myblog/spec/request/posts_pages_spec.rb (LoadError) | |
from /Users/angelito/.rvm/gems/ruby-1.9.3-p194@mysql2/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in `block in load_spec_files' | |
from /Users/angelito/.rvm/gems/ruby-1.9.3-p194@mysql2/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in `map' | |
from /Users/angelito/.rvm/gems/ruby-1.9.3-p194@mysql2/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in `load_spec_files' | |
from /Users/angelito/.rvm/gems/ruby-1.9.3-p194@mysql2/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:22:in `run' | |
from /Users/angelito/.rvm/gems/ruby-1.9.3-p194@mysql2/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:69:in `run' | |
from /Users/angelito/.rvm/gems/ruby-1.9.3-p194@mysql2/gems/rspec-core-2.11.1/lib/rspec/ |
This file contains 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
To use multiple MongoDB database through Mongoid use set_database inside the Mongoid model to set the database | |
module Cache | |
class Inquiry | |
include Mongoid::Document | |
set_database :cache | |
... | |
And add the configuration for :cache to mongoid.yml |
This file contains 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
$("strong.column#{oldvalue}").text "<%= I18n.t('frontend.import.column') %>#{oldvalue}" |
This file contains 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
#view | |
= select_tag "paisorigen", id: "country", "<option value=':PEN' >Perú</option> <option value=':COP'>Colombia</option><option value=':MXN'>Mexico</option><option value=':USD'>Otros</option>".html_safe, :include_blank => true, :class => "chosen required", :style => "padding: 8px 0px 0px 5px;width: 120px;margin: 18px 0px 4px 15px;", :required => "required " | |
#javascript | |
$(document).on 'change','select#country',(event) -> | |
target = $('#donde_se_va_mostrar') | |
country_code = $(@).val() | |
url = "/my_controller/my_method?country_code=#{country_code}" | |
target.load(url) |
This file contains 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
before_filter :load_resource_unit | |
before_filter :load_resource_budget, only: [:show, :edit, :update, :action_exception] | |
authorize_resource :unit | |
authorize_resource :budget, except: [:new, :create, :asign_clients, :save_clients] | |
authorize_resource :budget, through: :unit, only: [:new, :create, :destroy] | |
def load_resource_budget | |
@budget = Budget.find params[:id] |
This file contains 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 | |
def credito(monto, tasa, nombre, ruc) | |
puts "El monto maximo sera de " + monto.to_s | |
puts "La tasa sera de " + tasa.to_s | |
puts nombre | |
puts ruc | |
end | |
puts "Ingrese la razón social" | |
nombre = gets.chomp |
This file contains 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
= simple_form_for(@couple, url: save_family_clients_url, html: { multipart: true, id: 'form_modal_family', novalidate: true}, remote: true) do |f| | |
.head-modal | |
%p Asignacion de pareja | |
.body-modal.scroll-wrapp | |
= hidden_field_tag "parent", @parent.id | |
- if @parent.marital_status == 'M' | |
%fieldset | |
%legend Régimen de Propiedad | |
= f.input :married_regimen do | |
= f.select :married_regimen, [['Bienes Mancomunados', Client::REGIMENS[:community_property]], ['Bienes Separados', Client::REGIMENS[:separate_property]]] |
This file contains 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 Newsletter < ActiveRecord::Base | |
def deliver | |
sleep 5 # simulate long newsletter delivery | |
update_attribute(:delivered_at, Time.zone.now) | |
end | |
handle_asynchronously :deliver | |
end | |
=============== |
This file contains 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
#lib/startup_constraint.rb | |
class StartupConstraint | |
def matches?(request) | |
id = request.path.gsub("/", "") | |
Startup.find_by_slug(id) | |
end | |
end | |
#lib/user_constraint.rb | |
class UserConstraint |
This file contains 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
- show ||= 'cards' | |
- if show == 'list' | |
= div_for user, class: 'user-list' do | |
.user-description | |
.user-avatar | |
= avatar(user, class: "user-img") | |
.user-info | |
= link_to user.name, "", class: "name" | |
%p.role= user.role_name |
OlderNewer