Note: Run this script as the root user (no sudo calls are used in the script).
You will need the curl package installed, though I would have no idea why it wouldn't be installed by default:
zypper --non-interactive install curl
| $ rails console | |
| Loading development environment (Rails 3.0.6) | |
| ruby-1.8.7-p334 :001 > class; MyTestController < ApplicationController; end | |
| ruby-1.8.7-p334 :003 > MyTestController._process_action_callbacks.map{|c| c.filter}.compact | |
| => [:verify_authenticity_token, :authenticate_user!, :first_login?, :secure_from_admin?, :require_current_client] | |
| $ rails console | |
| Loading development environment (Rails 3.0.6) | |
| ruby-1.8.7-p334 :001 > r = Rails.application.routes | |
| Gives you a handle of all the routes (config/routes.rb) | |
| #Inspect a named route: | |
| ruby-1.8.7-p334 :005 > r.recognize_path(app.destroy_user_session_path) | |
| => {:action=>"destroy", :controller=>"sessions"} |
| # Add a controller to test some functionality in controller rspec | |
| class MyTestController < ApplicationController | |
| def index | |
| render :nothing => true | |
| end | |
| end | |
| # add | |
| before do |
| class SessionsController < Devise::SessionsController | |
| def destroy | |
| reset_session | |
| super | |
| end | |
| end | |
| # In your routes | |
| devise_for :users do |
| require 'spec_helper' | |
| class SessionsController < Devise::SessionsController | |
| def index | |
| session[:current_client] = "some value set in session" | |
| session[:some_other_value] = "some other value in session" | |
| render :nothing => true | |
| end | |
| end |
| # Checks whether it's a devise mapped resource or not. | |
| def is_devise_resource? #:nodoc: | |
| raise ActionController::UnknownAction unless devise_mapping | |
| end | |
| # And also | |
| # Attempt to find the mapped route for devise based on request path | |
| def devise_mapping | |
| @devise_mapping ||= request.env["devise.mapping"] |
| *** LOCAL GEMS *** | |
| abstract (1.0.0) | |
| actionmailer (3.0.9, 3.0.6) | |
| actionpack (3.0.9, 3.0.6) | |
| activemodel (3.0.9, 3.0.6) | |
| activerecord (3.0.9, 3.0.6) | |
| activerecord-sqlserver-adapter (3.0.15) | |
| activeresource (3.0.9, 3.0.6) | |
| activesupport (3.0.9, 3.0.6) |
| Amit-Kumars-MacBook-Pro:cytosite toamitkumar$ heroku create | |
| Creating radiant-cloud-8241... done, stack is bamboo-mri-1.9.2 | |
| http://radiant-cloud-8241.heroku.com/ | git@heroku.com:radiant-cloud-8241.git | |
| Git remote heroku added | |
| Amit-Kumars-MacBook-Pro:cytosite toamitkumar$ git push heroku master | |
| ! No such app as radiant-cloud-8241. |
| Amit-Kumars-MacBook-Pro:cytosite toamitkumar$ git remote -v | |
| heroku git@heroku.com:radiant-cloud-8241.git (fetch) | |
| heroku git@heroku.com:radiant-cloud-8241.git (push) | |
| origin git@github.com:toamitkumar/cytosite.git (fetch) | |
| origin git@github.com:toamitkumar/cytosite.git (push) | |
| Amit-Kumars-MacBook-Pro:cytosite toamitkumar$ git remote rm heroku | |
| Amit-Kumars-MacBook-Pro:cytosite toamitkumar$ git remote -v | |
| origin git@github.com:toamitkumar/cytosite.git (fetch) |