Skip to content

Instantly share code, notes, and snippets.

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
resources :groups do
collection :find
end
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
>> 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\"]}"
>>
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
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')
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')
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
#!/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'
##############################################################################
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