[Rails] Testing selector order in RSpec

2012-02-29 Thread Mike Kim
Could someone point me to a reference that explains how I would test the order of elements on an HTML page? For example, in RSpec I would like to verify that the content of one element appears before the content of another. response.should have_selector("p", :content => "Should appear first") re

[Rails] Re: what's wrong?

2012-02-11 Thread Mike Kim
> skip_filter :authenticate_user!, :only => [:index, :show] unless > @current_layout.nil? I'm guessing that the unless statement is being parsed as an argument to skip_filter. Try using parentheses like this: skip_filter(:authenticate_user!, :only => [:index, :show]) unless @current_layout.nil?

[Rails] ActiveRecord Associations not working in RSpec with Devise

2012-02-03 Thread Mike Kim
Hi everyone, I have the following classes: class User < ActiveRecord::Base devise :database_authenticatable, :registerable, :timeoutable, :recoverable, :rememberable, :trackable, :validatable has_many :comments, :dependent => destroy ... end class Comment < ActiveRecord::Base bel

[Rails] Re: Polymorphic associations with ownership

2012-02-03 Thread Mike Kim
Thanks, Tim Actually, and I haven't fully tested this out yet, I think it's simpler than that. Currently, I hvae the following: class Comment < ActiveRecord::Base belongs_to :user belongs_to :commentable, polymorphic => true ... end and that seems to be working. I have another issue now that

[Rails] Re: Polymorphic associations with ownership

2012-02-03 Thread Mike Kim
Just in case this wasn't clear, I would like every comment to belong to a user and only be editable by that user, but be associated with a product type (Camera, Book, etc.). This is why I doubt the simple class definition I outlined below would suffice. Best, Mike On Feb 3, 4:26 pm, Mik

[Rails] Polymorphic associations with ownership

2012-02-03 Thread Mike Kim
Hi everyone, I'm sure the answer is out there and quite simple, but I haven't been able to find it. Suppose I have the following classes with polymorphic associations: class Comment < ActiveRecord::Base belongs_to :commentable, :polymorphic => true end class Camera < ActiveRecord::Base has_

[Rails] Re: Does Devise make use of a "status" method? Weird bug.

2012-01-31 Thread Mike Kim
Duane, Try running "rake routes" in order to see which controller is being used for the create method. Hopefully that'll help narrow things down. Best, Mike On Jan 31, 7:45 pm, Duane Morin wrote: > So I've inherited a legacy application and I'm trying to work around the > edges as I put an adm

[Rails] Re: Using Mongoid with ActiveRecord and Devise

2012-01-23 Thread Mike Kim
e. I filed a bug with the Devise team. Hopefully I'm not wrong and just wasting people's time. Thanks, Mike On Jan 23, 10:00 pm, Mike Kim wrote: > Thanks Neener54, but I think I found the answer. > > Instead of running: > > > rails g model Blogpost > > I n

[Rails] Re: Using Mongoid with ActiveRecord and Devise

2012-01-23 Thread Mike Kim
#x27;ll keep an eye open > for you though and see if I can figure it out. > > On Jan 21, 7:41 pm, Mike Kim wrote: > > > I'm trying to use mongodb and postgresql simultaneously with Rails > > 3.1. I believe I have everything set up correctly. > > > What I&#

[Rails] Using Mongoid with ActiveRecord

2012-01-21 Thread Mike Kim
I'm trying to use mongodb and postgresql simultaneously with Rails 3.1. I believe I have everything set up correctly. What I'm interested in knowing is how to get rails to flip-flop back- and-forth between mongoid and activerecord. For example, if I want to generate an ActiveRecord model after us

Re: [Rails] Rails Wiki content not appearing

2011-12-14 Thread Mike Kim
Yes, I meant the wiki at http://wiki.rubyonrails.org. Thanks, Colin and Frederick, for checking. On Wed, Dec 14, 2011 at 1:15 AM, Frederick Cheung < frederick.che...@gmail.com> wrote: > > > On 14 Dec 2011, at 09:11, Colin Law wrote: > > > On 14 December 2011 03:13,

[Rails] Rails Wiki content not appearing

2011-12-13 Thread Mike Kim
Hi everyone, I apologize in advance for the newbie question, but I haven't been able to view any content on the Rails Wiki pages. All I get are the Table of Contents and the Discussions. I am able to view content when I click on "View Page Source", but obviously this is not ideal. I'm using Chrom