Skip to content

Instantly share code, notes, and snippets.

diff --git a/lib/merb-auth/controller/controller.rb b/lib/merb-auth/controller/controller.rb
index 56db895..b0f3375 100644
--- a/lib/merb-auth/controller/controller.rb
+++ b/lib/merb-auth/controller/controller.rb
@@ -81,9 +81,10 @@ module MerbAuth
# Redirect to the URI stored by the most recent store_location call or
# to the passed default.
- def redirect_back_or_default(default,message = "")
+ def redirect_back_or_default(default,msg = "")
aadi-mbp2:website aadid$ pwd
/Users/aadid/website
aadi-mbp2:website aadid$ ls -ld gems/gems/merb-auth-*
drwxr-xr-x 8 aadid staff 272 Sep 16 15:39 gems/gems/merb-auth-core-0.1.0
drwxr-xr-x 8 aadid staff 272 Sep 16 15:43 gems/gems/merb-auth-strategies-0.1.0
aadi-mbp2:website aadid$ thor merb:gems:uninstall merb-auth-strategies --all
Uninstalling merb-auth-strategies...
Failed to uninstall merb-auth-strategies (Gem is not installed in directory /Users/aadid/website/gems)
aadi-mbp2:website aadid$
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
#!/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'
##############################################################################
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
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')
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
>> 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\"]}"
>>
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