RailsCasts Pro episodes are now free!

Learn more or hide this

Ralph Larson's Profile

GitHub User: ralphlarson

Site: http://ralphlarson.publicoton.fr/

Comments by Ralph Larson

Avatar

Is there a convenient way to separate view and controller logic depending on the environment?

Avatar

Thanks Ryan!! I appreciate your clear mindedness that you demonstrate in your screencasts.

Avatar

Ryan, thank you for this episode. I would like to use CoffeeScript in Rails 3.0.7 app. How caan I use it?

Avatar

I needed to do the same thing: transform a field in a JSON blob that was sent with an HTTP POST to a Rails 3 app. In my case I just wanted to include a hashed digest of a field, so in config/application.rb:

config.filter_parameters += [:password, lambda {|key, value|
if key.to_s == 'my_key'
value.replace(calculate_my_hash(value))
end
}]

Avatar

The users controller stores the user object in the session.

class UsersController < ApplicationController
def index
session[:user] = User.first

redirect_to session[:user]

end

def show
@user = session[:user]
end

def update
@user = session[:user]
@user.first_name = 'Junk'

redirect_to session[:user]

end
end

Avatar

Thank you for this Railscast. Your work is slowly helping me understand the more interesting side of rails.

Avatar

The documentation says that the :find keywords “may include the :conditions, :joins, :include, :offset, :limit, and :readonly options”.