[Rails] Search form AND condition - Not working

2013-05-07 Thread Maddy
Hi Folks, My search fields, Firstname* Lastname* MI - Middle initial State* ID Birthday when people will search John Bolton in any state for example AL (Alabama), all John Bolton names in only AL will show up. So if there are 3 John Bolton with different middle MIs, they will show, for

[Rails] Search and routes

2013-05-07 Thread Paul Bergstrom
How do I define the route for a search form that goes to index action, which either lists all, if no search, or the search result? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To unsubscribe

[Rails] Access belongs_to on a Mongoid::Document subclass

2013-05-07 Thread Myth17
I have a model 'Index' as: class Index include Mongoid::Document belongs_to :project end Another model PercentileRankIndex inherits Index class PercentileRankIndex Index def self.model_name Index.model_name end end Suppose I do : p = Index.first (OR EVEN) p =

[Rails] Rake db:migrate

2013-05-07 Thread Lorenz Blackbird
Hello, I'm trying to use command rake db:migrate, but in MySQL I continuous get an empty set and I do know why. #/db/seeds.rb User.create(username: lorenz, password: mypass, admin: true) When I run: rake db:seed RAILS_ENV=development --trace I received: ** Invoke db:seed (first_time) **

Re: [Rails] Rake db:migrate

2013-05-07 Thread Colin Law
On 7 May 2013 11:18, Lorenz Blackbird li...@ruby-forum.com wrote: Hello, I'm trying to use command rake db:migrate, but in MySQL I continuous get an empty set and I do know why. #/db/seeds.rb User.create(username: lorenz, password: mypass, admin: true) When I run: rake db:seed

Re: [Rails] Search form AND condition - Not working

2013-05-07 Thread tamouse mailing lists
On Tue, May 7, 2013 at 1:08 AM, Maddy ashokku...@shriramits.com wrote: Hi Folks, My search fields, Firstname* Lastname* MI - Middle initial State* ID Birthday when people will search John Bolton in any state for example AL (Alabama), all John Bolton names in only AL will show up. So

Re: [Rails] Search form AND condition - Not working

2013-05-07 Thread Colin Law
On 7 May 2013 13:17, tamouse mailing lists tamouse.li...@gmail.com wrote: On Tue, May 7, 2013 at 1:08 AM, Maddy ashokku...@shriramits.com wrote: Hi Folks, My search fields, Firstname* Lastname* MI - Middle initial State* ID Birthday when people will search John Bolton in any state for

Re: [Rails] Search and routes

2013-05-07 Thread Dave Aronson
On Tue, May 7, 2013 at 3:38 AM, Paul Bergstrom li...@ruby-forum.com wrote: How do I define the route for a search form that goes to index action, which either lists all, if no search, or the search result? The route can be just the same as always. The way I've done this sort of thing is that

[Rails] validates :uniqueness apparently doesn't

2013-05-07 Thread Fritz Anderson
ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-darwin12.3.0] Rails 3.2.13 I have a validates ... :uniqueness constraint on one of the attributes of an ActiveRecord class. In my test suite, I set the attribute from the same attribute in a record in the fixture. I then send invalid? to the

[Rails] Net::HTTP

2013-05-07 Thread John Merlino
I'm looking at the documentation: http://ruby-doc.org/stdlib-2.0/libdoc/net/http/rdoc/Net/HTTP.html And I notice two uses of Net::HTTP. Both are using GET requests. But what's the difference? When to use which? Net::HTTP.start(uri.host, uri.port) do |http| request = Net::HTTP::Get.new uri

[Rails] Model Versioning + Scheduling

2013-05-07 Thread dcecuweb
Has anyone attempted a model design that incorporates both versioning and scheduling of model changes? As an example implementation: Each model version has a publish_on and expire_on date, the latest version that should be live, is presented. id content_id versionpublish_on

[Rails] Re: validates :uniqueness apparently doesn't

2013-05-07 Thread Robert Walker
Fritz Anderson wrote in post #1108098: ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-darwin12.3.0] Rails 3.2.13 I have a validates ... :uniqueness constraint on one of the attributes of an ActiveRecord class. In my test suite, I set the attribute from the same attribute in a record in

Re: [Rails] Roll your own authentication?

2013-05-07 Thread Linus Pettersson
Absolutely, that's a valid argument. However, if you need to do some customizations and start monkey patching a gem you may open it up for vulnerabilities as well, right? Plus, it would make your code messy when you have some code in your project and some in the gem. But sure, it is convient

Re: [Rails] Roll your own authentication?

2013-05-07 Thread Paul
+ for Devise I don't want to do all the work that has already been done for me by the Devise authors. I always generate the views and modify them to suit, and I generally create a partial to handle whatever login/logout/account settings links I need, but other than that, when writing a standard

[Rails] Trying to get my head around engines (I think)

2013-05-07 Thread Dan Meyers
I've noticed that there is certain base functionality that I always want in my Rails apps, and I end up reinventing the wheel for every app I write. The authentication can be provided by something like Devise (though i'll need to see if I can get it set up to do AD auth) but I also have a

Re: [Rails] Roll your own authentication?

2013-05-07 Thread tamouse mailing lists
On Tue, May 7, 2013 at 2:06 PM, Linus Pettersson linus.petters...@gmail.com wrote: Absolutely, that's a valid argument. However, if you need to do some customizations and start monkey patching a gem you may open it up for vulnerabilities as well, right? Plus, it would make your code messy when

Re: [Rails] Re: validates :uniqueness apparently doesn't

2013-05-07 Thread tamouse mailing lists
On Tue, May 7, 2013 at 1:37 PM, Robert Walker li...@ruby-forum.com wrote: Fritz Anderson wrote in post #1108098: ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-darwin12.3.0] Rails 3.2.13 I have a validates ... :uniqueness constraint on one of the attributes of an ActiveRecord class. In

Re: [Rails] Net::HTTP

2013-05-07 Thread tamouse mailing lists
On Tue, May 7, 2013 at 12:43 PM, John Merlino stoici...@aol.com wrote: I'm looking at the documentation: http://ruby-doc.org/stdlib-2.0/libdoc/net/http/rdoc/Net/HTTP.html And I notice two uses of Net::HTTP. Both are using GET requests. But what's the difference? When to use which?