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
resources :email_accounts do | |
member :make_primary , :to => 'make_primary' | |
member :choose_primary , :to => 'choose_primary' | |
collection :find_by_email, :to => 'find_by_email' | |
s identify( EmailAccount => [:escaped_confirmation_id, :confirmation_code] ).match('/confirm/:escaped_confirmation_id/:confirmation_code').to(:controller => 'email_accounts', :action => 'confirm').name(:confirm) | |
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
resources :groups do | |
collection :find | |
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
resources :groups do | |
match("/find").to(:action => 'find') | |
end | |
# results in /groups/:group_id/find | |
# how can i get it to just be /groups/find | |
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
>> a = { :hi => ['a','b','c'] } | |
=> {:hi=>["a", "b", "c"]} | |
>> a.to_json | |
merb : worker (port 4000) ~ Executed all before worker shutdown callbacks... | |
=> "{\"hi\":[\"a\",\"b\",\"c\"]}" | |
>> |
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
Merb::Config.use { |c| | |
c[:exception_details] = true | |
c[:reload_templates] = true | |
c[:reload_classes] = true | |
c[:reload_time] = 0.5 | |
c[:ignore_tampered_cookies] = true | |
c[:log_auto_flush ] = true | |
c[:log_level] = :debug | |
c[:log_stream] = STDOUT |
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
describe "new group" do | |
it "should show the form" do | |
User.stub!(:authenticate).and_return(User.new()) | |
response = request(url(:perform_login), :method => "PUT", :params => { :login => 'xxx', :password => 'xxx' } ) | |
@response = request(resource(:groups, :new)) | |
@response.should be_successful | |
@response.body.to_s.should have_tag(:form, :id => 'new-group') |
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
describe "new group" do | |
it "should show the form" do | |
User.stub!(:authenticate).and_return(User.new()) | |
response = request(url(:perform_login), :method => "PUT", :params => { :login => 'xxx', :password => 'xxx' } ) | |
@response = request(resource(:groups, :new)) | |
@response.should be_successful | |
@response.body.to_s.should have_tag(:form, :id => 'new-group') |
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 File.join(File.dirname(__FILE__), "..", 'spec_helper.rb') | |
given "logged in" do | |
User.stub!(:authenticate).and_return(User.new()) | |
response = request(url(:perform_login), :params => { :login => 'xxx', :password => 'xxx' } ) | |
end | |
describe "groups controller" do |
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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'thor' | |
require 'fileutils' | |
require 'yaml' | |
# Important - don't change this line or its position | |
MERB_THOR_VERSION = '0.0.5' | |
############################################################################## |
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 MarcasDeTiempo | |
def self.included(base) | |
# Propiedades especiales | |
# Permite guardar la fecha y hora de eliminación del recurso | |
property :deleted_at, ParanoidDateTime | |
# Permite conocer cuándo fue creado y cuándo fue modificado el recurso | |
property :created_at, DateTime | |
property :updated_at, DateTime | |
end | |
end |