search for: jimlindley

Displaying 10 results from an estimated 10 matches for "jimlindley".

2006 Aug 07
8
Rails Recipes question - authenticating users
Didn''t think I''d be back so quick with another question but here goes: In this recipe for the signin or login (as I call it) there are these two lines if the user authenticates correctly: session[:user] = user.id redirect_to :action => session[:intended_action], :controller => session[:intended_controller] So I''m not seeing anything in the way of an explanation
2006 Aug 07
2
Ugggh..another recipes question
sorry, because it seems that I need more explanation on this Rails Recipes authorization - I finally got the code working but after using the login I get this back from Rails- Routing Error No url can be generated for the hash {} I''m guessing it''s coming from the redirect- def login if request.post? session[:user] = User.authenticate(params[:first_name],
2006 Aug 14
2
ajax - layout problem.
Hi guys Here is my problem... Using Ajax to update a div with link_to_remote. Problem is I have a layout defined in my class, so, the div gets the layout when I call the method, how di I tell a method to ingore the layout? Cheers. Pieter. -------------- next part -------------- An HTML attachment was scrubbed... URL:
2006 Jul 09
1
Accessing the name of a controller''s module?
If I''m redirecting to a log in page, and saving the controller and action name in the session hash, how do I also save the controller module? After the log in is completed, I can''t redirect back to the originally directed page because it''s in a different controller module. For the controller action name I can use the ActionController instance method controller_name(),
2008 Jan 19
5
"should_not ==" vs "should !="
describe "should_not == vs. should !=" it do 5.should_not == 6 end # passes it do 5.should != 6 end # fails end # I''m running the rspec 1.1.2 gem with the corresponding Textmate bundle # The second failure surprises me. # Is != not supported? # I''d like to hear what you all think. -------------- next part -------------- An HTML attachment was
2007 Jan 20
2
Conditional pluralize without the number
Hi. Assume you have an array of person names. I want to generate results in my view that look like this: Abby is your friend or Abby, Bob, and Carol are your friends. So I''d like to say: <%= friends.to_sentence %> <%= pluralize(friends.count, "is") %> your <%= pluralize(friends.count, "friend") %> But because pluralize puts in the
2008 Jun 03
5
Autotest/RSpec 1.1.4/Rails 2.1 Infinite Loop?
I just got back from RailsConf, and upgraded on of my development apps to 2.1, and now autotest is going into an infinite loop. It runs tests continuously instead of waiting for files to be saved before rerunning. Has anybody else seen this, or know how to get around it? Thanks, Andrew
2006 Aug 14
3
validating required fields during an update?
I have a User model with an email attribute. I''m using the following validations: validates_confirmation_of :email validates_format_of :email, :with => RFC822::EmailAddress, :message => "must be a valid address in the form user@domain.com" validates_uniqueness_of :email, :message => "address has already been taken. If you''ve forgotten your
2007 Nov 06
10
Test case for file import
Hi Friends, I need to write the testcase for fileimport. Pls give me any idea -- Posted via http://www.ruby-forum.com/.
2007 Nov 01
8
Specifying mixins
Hi folks, Can anyone share some accumulated wisdom about the best way to spec mixins in general, and (Jamis Buck-style) ActiveRecord "concerns" in particular? The standard situation here is that there''s a bunch of functionality, related by concept if not by implementation, that one wants to inherit in many different classes (e.g. ActiveRecord models) without having to