Hi, I have a DB with table TABLENAME, column COLUMN and an active resource client trying to connect to the DB. When i do Tablename.find(:all) => i get all the entries from the table But Tablename.exists?(:column => value) always returns false I verified that the above command works from rails console. Dont understand why it always returns false even when there are valid records. And in the rails server terminal i see a request for this cmd failing as Started HEAD "/tablenames/columnnamevalue.json" for 127.0.0.1 at Mon Jun 18 13:02:11 -0700 2012 ActionController::RoutingError (No route matches [GET] "/tablenames/columnnamevalue.json"): actionpack (3.2.4) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'' actionpack (3.2.4) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'' railties (3.2.4) lib/rails/rack/logger.rb:26:in `call_app'' railties (3.2.4) lib/rails/rack/logger.rb:16:in `call'' actionpack (3.2.4) lib/action_dispatch/middleware/request_id.rb:22:in `call'' rack (1.4.1) lib/rack/methodoverride.rb:21:in `call'' rack (1.4.1) lib/rack/runtime.rb:17:in `call'' Can anyone tellme why its failing? -- 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 post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 18 June 2012 21:05, cyber c. <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hi, > > I have a DB with table TABLENAME, column COLUMN and an active resource > client trying to connect to the DB. When i do > > Tablename.find(:all) => i get all the entries from the table > But Tablename.exists?(:column => value) always returns falseCould you point me to some documentation for exists? that shows passing a column value other than an id? I cannot find any reference to that. Colin> I verified that the above command works from rails console. Dont > understand why it always returns false even when there are valid > records. > > And in the rails server terminal i see a request for this cmd failing as > > > Started HEAD "/tablenames/columnnamevalue.json" for 127.0.0.1 at Mon Jun > 18 13:02:11 -0700 2012 > > ActionController::RoutingError (No route matches [GET] > "/tablenames/columnnamevalue.json"): > actionpack (3.2.4) > lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'' > actionpack (3.2.4) > lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'' > railties (3.2.4) lib/rails/rack/logger.rb:26:in `call_app'' > railties (3.2.4) lib/rails/rack/logger.rb:16:in `call'' > actionpack (3.2.4) lib/action_dispatch/middleware/request_id.rb:22:in > `call'' > rack (1.4.1) lib/rack/methodoverride.rb:21:in `call'' > rack (1.4.1) lib/rack/runtime.rb:17:in `call'' > > Can anyone tellme why its failing? > > -- > 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 post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Im sorry i have looked at wrong documentation. I have to use find(:all, :params) -- 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 post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Jun 18, 9:57 pm, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 18 June 2012 21:05, cyber c. <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: > > > Hi, > > > I have a DB with table TABLENAME, column COLUMN and an active resource > > client trying to connect to the DB. When i do > > > Tablename.find(:all) => i get all the entries from the table > > But Tablename.exists?(:column => value) always returns false > > Could you point me to some documentation for exists? that shows > passing a column value other than an id? I cannot find any reference > to that. >http://apidock.com/rails/ActiveRecord/FinderMethods/exists%3F has various forms exists? accepts Fred -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hi Frederick, Activeresource exists doesnt support conditions i think . Even i got confused by activerecord and activeresource exists method. -- 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 post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Seemingly Similar Threads
- Rails 3 Errno::EAFNOSUPPORT: Address family not supported by protocol - socket(2)
- Rails 3 Errno::EAFNOSUPPORT: Address family not supported by protocol - socket(2)
- Rails 4.0 has_many_through and fields_for
- help stylesheet_link_tag
- Compiled assets are not found in production mode run locally