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 PasswordsController < Devise::PasswordsController | |
before_filter :set_request_for_mailer | |
# POST /resource/password | |
def create | |
@resources = User.send_reset_password_instructions(params[resource_name]) | |
self.resource = @resources.is_a?(Array) ? @resources[0] : @resources | |
if resource.errors.empty? | |
set_flash_message :notice, :send_instructions | |
redirect_to new_session_path(resource_name) |
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
(defprotocol T "test" (getclass [this])) | |
(extend-type clojure.lang.PersistentArrayMap T (getclass [this] (class this))) | |
(getclass {}) | |
(defmacro makeT [klass] `(extend-type ~klass T (getclass [this] (class this)))) | |
(makeT String) |
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
#This is for Devise 1.2.x | |
# To your routes file add: | |
as :user do | |
match '/user/confirmation' => 'confirmations#update', :via => :put, :as=> :update_user_confirmation | |
end | |
# Add this inherited confirmations controller as app/controllers/confirmations_controller.rb |
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
#This is for Devise 1.0.9 | |
# To your routes file add: | |
map.update_user_confirmation '/user/confirmation', :controller => 'confirmations', :action => 'update', :conditions => { :method => :put } | |
# Add this replacement confirmations controller as app/controllers/confirmations_controller.rb | |
class ConfirmationsController < ApplicationController |
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
737 def compute_public_path(source, dir, ext = nil, include_host = true) | |
738 return source if is_uri?(source) | |
739 | |
740 source += ".#{ext}" if rewrite_extension?(source, dir, ext) | |
741 source = "/#{dir}/#{source}" unless source[0] == ?/ | |
=> 742 source = rewrite_asset_path(source, config.asset_path) | |
743 | |
744 has_request = controller.respond_to?(:request) | |
745 if has_request && include_host && source !~ %r{^#{controller.config.relative_url_root}/} | |
746 source = "#{controller.config.relative_url_root}#{source}" |
NewerOlder