[Rails] I get Error after creating product

2010-08-17 Thread Musdev Musdev
I get the following error inside my browser: ActiveRecord::RecordNotFound in ProductsController#show Couldn't find Product without an ID RAILS_ROOT: /Users/musdev/work/depot Application Trace | Framework Trace | Full Trace

[Rails] Re: I get Error after creating product

2010-08-17 Thread Anubhaw Prakash
Musdev Musdev wrote: I get the following error inside my browser: ActiveRecord::RecordNotFound in ProductsController#show Couldn't find Product without an ID Request Parameters: {id=2} The code on line 17 in my controller looks like this def show @product =

[Rails] Re: How to development Database for testing

2010-08-17 Thread Rajkumar Surabhi
Marnen Laibow-Koser wrote: hi, May be but i need it to use single development database for both enviroments -- 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

[Rails] Re: respond_to json gives error: no route matches /schedules/list.json with {:method=:get}

2010-08-17 Thread neigaard
I mean I only have the default routes, that also includes the route in my first post. Here is my routes.rb: ActionController::Routing::Routes.draw do |map| map.connect ':controller/:action/:id' map.connect ':controller/:action/:id.:format' end Any ideas? Thank you Søren -- You received

Re: [Rails] [Form] Method POST PUT problem

2010-08-17 Thread Peter De Berdt
On 17 Aug 2010, at 05:19, David Sousa wrote: I have a form that should be a POST method, but Rails insist to put a hidden field _method that has the value put does anyone knows why? Since @user already exists in the database (you assign an existing record @current_user to it) and is not a

Re: [Rails] First Test Failures: Anything Obvious?

2010-08-17 Thread Colin Law
On 17 August 2010 05:18, Terry Michaels li...@ruby-forum.com wrote: Still following my rails book (more like, adapting to my project as I go). My first attempt at a unit test failed. Adapting the example in the book, I came up with this: require 'test_helper' class RecordingTest

Re: [Rails] First Test Failures: Anything Obvious?

2010-08-17 Thread Colin Law
On 17 August 2010 06:31, Gintautas Šimkus dihita...@gmail.com wrote: Try to save the object first and then check for validity. I don't think that is right, for a start it will not save if it is invalid. Colin -- You received this message because you are subscribed to the Google Groups Ruby

[Rails] Dose custom rake task ignore observer?

2010-08-17 Thread boblu
I have an observer which will do some tidy up work around Model A. But when I create or destroy A's instance inside a custom rake task, the observer seems not get called at all? Can some one explain this? -- You received this message because you are subscribed to the Google Groups Ruby on

[Rails] Re: Rails 3.0.0.rc Hosting

2010-08-17 Thread gezope
Hi, http://www.railshostinginfo.com/ a good page helps you making your decision. If you are interested in what makes a Rails hosting good: http://www.railshosting.org/ excellent info. Because of Rails easy to develop but hard to deploy (for me it is hard), it is better to choose one which

[Rails] Rackspace is hiring Ruby on Rails Developers in Austin, TX and San Antonio, TX

2010-08-17 Thread O
Hello, Here at Rackspace we embrace open source development and are currently engaged in a number of projects using Ruby on Rails. We need more developers and are currently growing our teams in San Antonio and Austin TX. If you are interested In discussing development opportunities please take

[Rails] How to use local javascript library for development and externally hosted for production?

2010-08-17 Thread lexer
Hi guys, I want to set up my RoR project to use local javascript library for development and externally hosted for production (for example jquery from google). How it could be achieved? Regards, Alexey Zakharov -- You received this message because you are subscribed to the Google Groups Ruby

[Rails] Storing a hash or array in the db

2010-08-17 Thread madisonkel
Hello -- I know that I can use serialize to declare hashes or arrays in a class that need to be used in the db. From http://api.rubyonrails.org/classes/ActiveRecord/Base.html: class User ActiveRecord::Base serialize :preferences end user = User.create(:preferences = { background =

Re: [Rails] How to use local javascript library for development and externally hosted for production?

2010-08-17 Thread Peter De Berdt
On 17 Aug 2010, at 07:07, lexer wrote: I want to set up my RoR project to use local javascript library for development and externally hosted for production (for example jquery from google). How it could be achieved? % if RAILS_ENV=production javascript_include_tag

Re: [Rails] Storing a hash or array in the db

2010-08-17 Thread Chris Mear
On 17 August 2010 03:35, madisonkel madisonkel...@gmail.com wrote: I know that I can use serialize to declare hashes or arrays in a class that need to be used in the db. From http://api.rubyonrails.org/classes/ActiveRecord/Base.html:  class User ActiveRecord::Base    serialize :preferences

Re: [Rails] How to use local javascript library for development and externally hosted for production?

2010-08-17 Thread Peter De Berdt
On 17 Aug 2010, at 11:05, Peter De Berdt wrote: % if RAILS_ENV=production Typo: % if RAILS_ENV==production -- 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-t...@googlegroups.com. To

Re: [Rails] How to use local javascript library for development and externally hosted for production?

2010-08-17 Thread Chris Mear
On 17 August 2010 10:07, Peter De Berdt peter.de.be...@pandora.be wrote: On 17 Aug 2010, at 11:05, Peter De Berdt wrote: % if RAILS_ENV=production Typo: % if RAILS_ENV==production As an aside, the RAILS_ENV constant is now deprecated; the new way to do this test is: if

[Rails] Can't able to debug my application

2010-08-17 Thread Periyasamy Ramachandiran
Hi, I am not able to debug my *.html.erb file in ruby. The breakpoints leaves when debugging?. Can anybody help me why i can't do? Regards, Periyasamy.R -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk

Re: [Rails] Can't able to debug my application

2010-08-17 Thread Colin Law
On 17 August 2010 10:13, Periyasamy Ramachandiran li...@ruby-forum.com wrote: Hi, I am not able to debug my *.html.erb file in ruby. The breakpoints leaves when debugging?. Can anybody help me why i can't do? Sorry I do not understand exactly the problem you are seeing. Are you able to break

[Rails] Re: Can't able to debug my application

2010-08-17 Thread Periyasamy Ramachandiran
Colin Law wrote: On 17 August 2010 10:13, Periyasamy Ramachandiran li...@ruby-forum.com wrote: Hi, I am not able to debug my *.html.erb file in ruby. The breakpoints leaves when debugging?. Can anybody help me why i can't do? Sorry I do not understand exactly the problem you are seeing.

Re: [Rails] Re: Can't able to debug my application

2010-08-17 Thread Colin Law
On 17 August 2010 10:49, Periyasamy Ramachandiran li...@ruby-forum.com wrote: [...] Thanks for your reply. I can able to do in controller as well as in model. But in .html.erb file i can't able to debug all the statements. Some lines only getting debugging. I also have the gem ruby-debug-base

[Rails] Routes.rb

2010-08-17 Thread Hemant Bhargava
Hello All, In routes.rb, to create and access a new page everytime i need to write :page_name = :any to my config/routes.rb. Can you guys tell me any better alternative to this? Thanks in advance. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are

[Rails] Re: filter help when attribute changes to call procedure

2010-08-17 Thread AppleII717
I guess I forgot to mention this is rails3 and the edge rdoc threw me off. In Rails 2.1+ there is ActiveRecord::dirty class, which looked like what I wanted. But in Rails 3 there is no ActiveRecord::dirty class. There is ActiveModel::dirty - and that is what I was referring to that I was not sure

[Rails] Re: Re: Can't able to debug my application

2010-08-17 Thread Periyasamy Ramachandiran
Colin Law wrote: On 17 August 2010 10:49, Periyasamy Ramachandiran li...@ruby-forum.com wrote: [...] Thanks for your reply. I can able to do in controller as well as in model. But in .html.erb file i can't able to debug all the statements. Some lines only getting debugging. I also have the

Re: [Rails] Re: Re: Can't able to debug my application

2010-08-17 Thread Colin Law
On 17 August 2010 11:14, Periyasamy Ramachandiran li...@ruby-forum.com wrote: Colin Law wrote: On 17 August 2010 10:49, Periyasamy Ramachandiran li...@ruby-forum.com wrote: [...] Thanks for your reply. I can able to do in controller as well as in model. But in .html.erb file i can't able to

[Rails] safariwatir - clicking a dialog box

2010-08-17 Thread bingo bob
Not hopeful that anyone else is doing this but I thought I'd try. safariwatir is a pretty fun way to test an app by remote controlling the browser. Seems to work well. Useful. One thing though (and I think this horse has been flogged before but I can't find an answer). In safariwatir specfically;

[Rails] Re: I get Error after creating product

2010-08-17 Thread Musdev Musdev
Anubhaw Prakash wrote: Musdev Musdev wrote: I get the following error inside my browser: ActiveRecord::RecordNotFound in ProductsController#show Couldn't find Product without an ID Request Parameters: {id=2} The code on line 17 in my controller looks like this def show

[Rails] Re: How to development Database for testing

2010-08-17 Thread stephenallred
On Aug 17, 7:54 am, Rajkumar Surabhi li...@ruby-forum.com wrote: May be but i need it to use single development database for both enviroments Why? -- 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

[Rails] Re: I get Error after creating product

2010-08-17 Thread Anubhaw Prakash
Hi, stack level too deep error is not due to code modifications. Taking a look at following article might solve your problem 'http://dalibornasevic.com/posts/5-ruby-stack-level-too-deep-systemstackerror'. The error is due to system stack level being less then required by application. Thanks,

[Rails] Re: respond_to json gives error: no route matches /schedules/list.json with {:method=:get}

2010-08-17 Thread neigaard
Bumping this, I need some help please :) -- 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-t...@googlegroups.com. To unsubscribe from this group, send email to

[Rails] Re: How to development Database for testing

2010-08-17 Thread Marnen Laibow-Koser
stephenallred wrote: On Aug 17, 7:54�am, Rajkumar Surabhi li...@ruby-forum.com wrote: May be but i need it to use single development database for both enviroments Why? Why indeed? That's a BAD, DANGEROUS practice. Best, --  Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org Sent

[Rails] Re: [Form] Method POST PUT problem

2010-08-17 Thread David Sousa
Thanks Peter, just adding :method = :post worked. Let me ask one more thing, just after a submit the form, the firefox open a dialog box asking me each of users that is in a list that I want to change the password. Actually does not matter each you pick, the user that you are logon on the site

[Rails] Re: Storing a hash or array in the db

2010-08-17 Thread Marnen Laibow-Koser
Chris Mear wrote: On 17 August 2010 03:35, madisonkel madisonkel...@gmail.com wrote: My question is what type do you give the variable :preferences for the migration? In: ruby script/generate migration _add_hash_column preferences:??? What is ??? -- text, string, something else? From the

[Rails] Re: Building Gems

2010-08-17 Thread Marnen Laibow-Koser
Daniel G. wrote: Hello all, I have been searching for a good tutorial of how to build a gem in Rails 3. I have found someones, but has not that good explained. I haven't build either a gem or plugin even in Rails 2.3.*, and I don't know if there were a change in the way a gem is built

Re: [Rails] Routes.rb

2010-08-17 Thread Jim Croft
On 17 Aug 2010, at 11:00, Hemant Bhargava wrote: In routes.rb, to create and access a new page everytime i need to write :page_name = :any to my config/routes.rb. Can you guys tell me any better alternative to this? I'm not 100% sure I understoon what you're after but take a look at:

[Rails] Help with a few modifications to the Blog in 15 Minutes screencast

2010-08-17 Thread kaspir
Hi, I'm fairly new to rails, and I recently followed the screencast on the rails site to make a blog. Everything is working quite well, and I'm understanding the majority of it, but there's two things I want to do, that I'm not sure how to approach. 1) My blog posts display in ascending order.

[Rails] Polymorphic Assosiations

2010-08-17 Thread Sateesh Kambhamapati
I have doubts on Polymorphic Assosiations. On Which situations we are using these?? What are the advantages? -- 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

[Rails] multiple model search with acts_as_solr_reloaded

2010-08-17 Thread Manivannan Jeganathan
I have used act_as_solr_reloaded plugin for searching option in my project I have two models which are brand and sku and its association are class Brand ActiveRecord::Base acts_as_solr :include = [:skus],:fields = [:id,:name,:description,:active] end class Sku ActiveRecord::Base acts_as_solr

Re: [Rails] Polymorphic Assosiations

2010-08-17 Thread Jim Croft
On 17 Aug 2010, at 13:37, Sateesh Kambhamapati wrote: I have doubts on Polymorphic Assosiations. On Which situations we are using these?? I used these recently for a pinboard. We have an internal system that contains contact management, support tickets, products services, billing etc. These

[Rails] Re: I get Error after creating product

2010-08-17 Thread Musdev Musdev
Anubhaw Prakash wrote: Hi, stack level too deep error is not due to code modifications. Taking a look at following article might solve your problem 'http://dalibornasevic.com/posts/5-ruby-stack-level-too-deep-systemstackerror'. The error is due to system stack level being less then

[Rails] Re: Help with a few modifications to the Blog in 15 Minutes screencast

2010-08-17 Thread kaspir
Disregard this message I figured everything out myself On Aug 17, 7:35 am, kaspir tre...@nugendesign.com wrote: Hi, I'm fairly new to rails, and I recently followed the screencast on the rails site to make a blog. Everything is working quite well, and I'm understanding the majority of it, but

[Rails] Re: I get Error after creating product

2010-08-17 Thread Ar Chron
You don't need to reference the show.html.erb in your controller... template implementations have that # show.html.erb text as a reminder of which view is invoked. def show @product = Product.find(params[:id]) respond_to do |format| format.html # show.html.erb format.xml { render

[Rails] Re: How to use local javascript library for development and externally hosted for production?

2010-08-17 Thread Tim Shaffer
Another option is to create your own configuration file and use the URL to the JavaScript file as a configuration variable. See here: http://railscasts.com/episodes/85-yaml-configuration-file -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk

[Rails] Re: Storing a hash or array in the db

2010-08-17 Thread Robert Walker
Marnen Laibow-Koser wrote: Chris Mear wrote: On 17 August 2010 03:35, madisonkel madisonkel...@gmail.com wrote: My question is what type do you give the variable :preferences for the migration? In: But I'd worry more about why you're storing an array in the DB. There are some legitimate

[Rails] Re: Routes.rb

2010-08-17 Thread Ar Chron
Hemant Bhargava wrote: In routes.rb, to create and access a new page everytime i need to write :page_name = :any to my config/routes.rb. Why? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group.

[Rails] Re: Routes.rb

2010-08-17 Thread Hemant Bhargava
Ar Chron wrote: Hemant Bhargava wrote: In routes.rb, to create and access a new page everytime i need to write :page_name = :any to my config/routes.rb. Ok. Here is the whole scenario for those who did'nt get it. I am using scaffolding type for resumes, portals, agencies etc etc. For

[Rails] Re: Storing a hash or array in the db

2010-08-17 Thread Marnen Laibow-Koser
Robert Walker wrote: Marnen Laibow-Koser wrote: Chris Mear wrote: On 17 August 2010 03:35, madisonkel madisonkel...@gmail.com wrote: My question is what type do you give the variable :preferences for the migration? In: But I'd worry more about why you're storing an array in the DB. There

[Rails] Re: How to development Database for testing

2010-08-17 Thread Ar Chron
Rajkumar Surabhi wrote: Marnen Laibow-Koser wrote: hi, May be but i need it to use single development database for both enviroments Rails makes the right things to do very easy, and if you stray outside that, well you made a conscious decision to go that route, and bear the consequences.

Re: [Rails] Re: Routes.rb

2010-08-17 Thread Colin Law
On 17 August 2010 14:48, Hemant Bhargava li...@ruby-forum.com wrote: Ar Chron wrote: Hemant Bhargava wrote: In routes.rb, to create and access a new page everytime i need to write :page_name = :any to my config/routes.rb. Ok. Here is the whole scenario for those who did'nt get it. I am

[Rails] Re: Routes.rb

2010-08-17 Thread Ar Chron
Hemant Bhargava wrote: I also have map.resources for resumes. Now my question is that if i add a new page(lets say create_forward) i need to describe it like this in routes.rb, map.resources :resumes, :collection = { :create_forward } and if i add a new page (create_req) then i need

[Rails] Re: Re: Routes.rb

2010-08-17 Thread Hemant Bhargava
Colin Law wrote: On 17 August 2010 14:48, Hemant Bhargava li...@ruby-forum.com wrote: Hope you people got it right.. :) So are you asking the question is there a better way do define the route for create_req rather than specifying it as you have above? I don't see how it could be much

[Rails] Devise manual password change

2010-08-17 Thread nico itkin
Hello, i'm trying to use devise gem 1.1.1 on a new rails 3 app, I would like to change the password of my users from the console, user.password= works well in dev, but in production, despite the encrypted password has changed, i can't log in the application.

Re: [Rails] Re: compass dosent work for me

2010-08-17 Thread Hassan Schroeder
On Mon, Aug 16, 2010 at 10:19 PM, nirosh kunalan.kand...@gmail.com wrote: sudo gem install compass. but getting error when running compass version that populate an error msg (compass: command not found) Odd, but apparently it didn't get added to your existing PATH. You'll have to find where

[Rails] Re: Re: Routes.rb

2010-08-17 Thread Marnen Laibow-Koser
Hemant Bhargava wrote: Colin Law wrote: On 17 August 2010 14:48, Hemant Bhargava li...@ruby-forum.com wrote: Hope you people got it right.. :) So are you asking the question is there a better way do define the route for create_req rather than specifying it as you have above? I don't see

[Rails] Re: Polymorphic Assosiations

2010-08-17 Thread Ar Chron
Sateesh Kambhamapati wrote: I have doubts on Polymorphic Assosiations. On Which situations we are using these?? What are the advantages? I use polymorphic associations all over the place in one application... mostly for the reporting and research aspect of the application. A

[Rails] Re: Executing js.erb file with :format ='js'

2010-08-17 Thread The Ultimation
yeah I'm now trying to do something more along the lines of what you suggested with jquery's $.ajax function. Almost there for the most part. Thanks for your suggestions -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups Ruby

[Rails] Re: compass dosent work for me

2010-08-17 Thread AppleII717
Might try locate bin/compass to see what bin directory it is installed in and compare against your path. Steve Alex On Aug 17, 9:12 am, Hassan Schroeder hassan.schroe...@gmail.com wrote: On Mon, Aug 16, 2010 at 10:19 PM, nirosh kunalan.kand...@gmail.com wrote: sudo gem install compass.

[Rails] Rake and Unitizialized Constants when RAIL_ENV is specified

2010-08-17 Thread Leonardo Mateo
Hi guys, I'm having a problem with rake and rails 2.3.5 When I use any model inside db/seeds.rb or in any rake task and the RAILS_ENV var is specified, I get the error: uninitialized constant ModelName Any clues? Thanks a lot in advance. -- Leonardo Mateo. There's no place like ~ -- You

Re: [Rails] Re: Building Gems

2010-08-17 Thread Daniel G.
I am trying to extend Rails. I read something about Railties... that's why I was looking for information about building Gems for Rails 3 Thanks, Daniel G. 10/8/17 Marnen Laibow-Koser li...@ruby-forum.com Daniel G. wrote: Hello all, I have been searching for a good tutorial of how to

[Rails] Using a href in a text field

2010-08-17 Thread Kaspir Ghost
If this is a really stupid noob question I apologize in advance, and appreciate any answers I get from this. I made a blog with rails, and just finished with the design. Upon creating my first real post, I realized I couldn't put links in my posts. I mean I can write links yes, but what I want to

Re: [Rails] Using a href in a text field

2010-08-17 Thread Dave Aronson
On Tue, Aug 17, 2010 at 11:18, Kaspir Ghost li...@ruby-forum.com wrote: I couldn't put links in my posts. I mean I can write links yes, but what I want to do is this: [code] blah blah blah a href=http://www.site.com;site/a blah blah blah [/code] Looks to me like you're running afoul of

Re: [Rails] Using a href in a text field

2010-08-17 Thread Colin Law
On 17 August 2010 16:18, Kaspir Ghost li...@ruby-forum.com wrote: If this is a really stupid noob question I apologize in advance, and appreciate any answers I get from this. I made a blog with rails, and just finished with the design. Upon creating my first real post, I realized I couldn't

[Rails] Re: Using a href in a text field

2010-08-17 Thread Kaspir Ghost
Dave Aronson wrote: On Tue, Aug 17, 2010 at 11:18, Kaspir Ghost li...@ruby-forum.com wrote: I couldn't put links in my posts. I mean I can write links yes, but what I want to do is this: [code] blah blah blah a href=http://www.site.com;site/a blah blah blah [/code] Looks to me like

[Rails] Installing selenium-on-rails - error on rake test

2010-08-17 Thread David Kahn
I'm following the instructions on installing Selenium on rails: Run the Rakefile in the plugin???s directory to run the tests in order to see that everything works When I rake: DKMac:selenium-on-rails DK$ rake test I get the following error:

Re: [Rails] Re: Using a href in a text field

2010-08-17 Thread Dave Aronson
On Tue, Aug 17, 2010 at 11:32, Kaspir Ghost li...@ruby-forum.com wrote: I am the only user on the site. Does either option still present a threat for me? If you allow people to comment, then their comments must likewise be sanitized. If you do not, then that is an indirect hazard to you --

[Rails] Re: How to development Database for testing

2010-08-17 Thread Agoofin
Take a look at some Rails testing resources - http://guides.rubyonrails.org/testing.html - take a look at the fixtures part. I can't think of a reason not to have a separate testing database or to try and run tests on the dev db, unless you are trying to re-invent the wheel and make your own

[Rails] [rails 3] how to write an Ajax call w the new unobtrusive js ?

2010-08-17 Thread Erwin
I have current a js function call I would like to transform into an Ajax request = check_box_tag selection, 1, false, {:id = user.id, :onclick = showHideMenuItem(this);} I found a lot of examples on link_to , but none on a checkbox .. I know I have to add :remote = true somewhere, but

[Rails] Re: getting started: quick question virtual rails

2010-08-17 Thread Marnen Laibow-Koser
Marnen Laibow-Koser wrote: Rich d wrote: I am running Linux Mint with virtual machine and virtual rails installed on my laptop...I am barely learning ruby on rails and still a novice...now that I have virtual rails installed I am assuming I use the netbeans IDE 6.8 for building applications

Re: [Rails] Re: Building Gems

2010-08-17 Thread Bill Walton
Hi Daniel, On Tue, Aug 17, 2010 at 10:11 AM, Daniel G. daniel.gaytan.n...@gmail.com wrote: I am trying to extend Rails. Gems extend Ruby, not Rails. Plugins and Engines are the mechanisms to extend Rails. Of course, any extension to Ruby extends Rails as well and it's not uncommon to see a

[Rails] Re: I get Error after creating product

2010-08-17 Thread Musdev Musdev
Ar Chron wrote: You don't need to reference the show.html.erb in your controller... template implementations have that # show.html.erb text as a reminder of which view is invoked. def show @product = Product.find(params[:id]) respond_to do |format| format.html # show.html.erb

[Rails] Re: I get Error after creating product

2010-08-17 Thread Frederick Cheung
On Aug 17, 6:48 pm, Musdev Musdev li...@ruby-forum.com wrote: Thanks Chron, that solution resolved my issue, I dropped the reference to show.html and it worked perfect. SO if the method is the same name as the view, I should never reference that view in the controller inside the method

[Rails] rails named scopes joined with OR

2010-08-17 Thread Sandip Ransing
Is it possible to have OR conditions using named scope ?? For e.g. Gather users based on following or conditions. 1. active is one named scope which finds all users whose state is active 2. OR user id is in 1,2,3 This condition can be written in only one named scope as named_scope

[Rails] save! neither saves nor raises error

2010-08-17 Thread Fearless Fool
I don't like this. This makes me grumpy, and I've even already had my morning coffee. obs[0] is a PremiseObservation, save! completed without error, yet nothing was written to the db. This is a serious ass-biter: irb(main):057:0 PremiseObservation.count = 0 irb(main):058:0 obs =

[Rails] Extending ActiveRecords in Rails 3

2010-08-17 Thread Bharat Ruparel
I have added a method to the ActiveRecords module and put it in the lib directory like so: module ActiveRecord class Base def self.my_search(search, current_page, search_field, user_role, perms) ... end end end This method has worked flawlessly in Rails 2.3.x and still works

[Rails] Re: save! neither saves nor raises error

2010-08-17 Thread Frederick Cheung
On Aug 17, 8:42 pm, Fearless Fool li...@ruby-forum.com wrote: How can save! complete without error and yet not save anything?  Either I've overlooked some key piece of documentation or else this is a bug. Which is it? You've got it out of find_by_sql so rails thinks its an existing row.

[Rails] Re: save! neither saves nor raises error

2010-08-17 Thread Fearless Fool
Frederick Cheung wrote: You've got it out of find_by_sql so rails thinks its an existing row. Furthermore rails doesn't think the object has changed since you retrieved it from the database, so it shortcircuits the save (since from its point of view there is nothing to save) Fred Fred:

Re: [Rails] Re: Storing a hash or array in the db

2010-08-17 Thread Madison Kelly
I'm using an array to store a list of catagories that a product will belong to. Since the number of catagories a product can belong to isn't set (could be 1 or could be 10), I was going to use an array. Does that sound like an appropriate use? On Tue, Aug 17, 2010 at 6:49 AM, Marnen Laibow-Koser

Re: [Rails] Re: Storing a hash or array in the db

2010-08-17 Thread Craig White
On Tue, 2010-08-17 at 14:00 -0700, Madison Kelly wrote: I'm using an array to store a list of catagories that a product will belong to. Since the number of catagories a product can belong to isn't set (could be 1 or could be 10), I was going to use an array. Does that sound like an appropriate

[Rails] Re: Re: Storing a hash or array in the db

2010-08-17 Thread Marnen Laibow-Koser
Madison Kelly wrote: I'm using an array to store a list of catagories that a product will belong to. Since the number of catagories a product can belong to isn't set (could be 1 or could be 10), I was going to use an array. Does that sound like an appropriate use? Absolutely not. For

[Rails] Re: Re: Storing a hash or array in the db

2010-08-17 Thread Marnen Laibow-Koser
Craig White wrote: On Tue, 2010-08-17 at 14:00 -0700, Madison Kelly wrote: I'm using an array to store a list of catagories that a product will belong to. Since the number of catagories a product can belong to isn't set (could be 1 or could be 10), I was going to use an array. Does that sound

Re: [Rails] Re: Storing a hash or array in the db

2010-08-17 Thread Colin Law
On 17 August 2010 22:00, Madison Kelly madisonkel...@gmail.com wrote: I'm using an array to store a list of catagories that a product will belong to. Since the number of catagories a product can belong to isn't set (could be 1 or could be 10), I was going to use an array. Does that sound like

[Rails] Re: rails named scopes joined with OR

2010-08-17 Thread Marnen Laibow-Koser
Sandip Ransing wrote: Is it possible to have OR conditions using named scope ?? For e.g. Gather users based on following or conditions. 1. active is one named scope which finds all users whose state is active 2. OR user id is in 1,2,3 This condition can be written in only one named scope as

[Rails] Re: save! neither saves nor raises error

2010-08-17 Thread Frederick Cheung
On Aug 17, 9:31 pm, Fearless Fool li...@ruby-forum.com wrote: Frederick Cheung wrote: You've got it out of find_by_sql so rails thinks its an existing row. Furthermore rails doesn't think the object has changed since you retrieved it from the database, so it shortcircuits the save (since

Re: [Rails] Re: rails named scopes joined with OR

2010-08-17 Thread Sandip Ransing
Marnen thx for reply ! Actually I wanted to add OR condition to acts_as_mappable finders, So that result-set will contain my own preferences too...but now it looks like for this purpose i may either need to mess up with library of rails_geokit plugin or override source of named_scope :( On

[Rails] Re: Re: rails named scopes joined with OR

2010-08-17 Thread Marnen Laibow-Koser
Sandip Ransing wrote: Marnen thx for reply ! Actually I wanted to add OR condition to acts_as_mappable finders, So that result-set will contain my own preferences too...but now it looks like for this purpose i may either need to mess up with library of rails_geokit plugin or override

[Rails] Student-course system

2010-08-17 Thread Allspam Only
Hi, I'm a newbie, and I have a basic question. Please help me out with this. I'm trying to create a system for the student-course enrollment management. These are the steps I've followed so far 1) rails App 2) script/generate scaffold Student name:string email:string 3) script/generate scaffold

[Rails] no route matches ..... for form_remote_tag

2010-08-17 Thread Tomasz Romanowski
I get an error: No route matches {:controller = :controller, :action=add_groups} when loading a form under users containing: % form_remote_tag :url = { :controller = :users, :action = :add_groups } do % % end % I do have an add_groups method in UsersController. I have not messed with

[Rails] Re: Re: activerecord re-sets class members to null??

2010-08-17 Thread Tomasz Romanowski
Rails comes with 3 development environments already ready to go, look database.yml. In development and testing, all classes are always reloaded. This does not seem to be true. In my example above, if a class does not derive from ActiveRecord::Base it preserves its class attributes between

[Rails] Re: activerecord re-sets class members to null??

2010-08-17 Thread Frederick Cheung
On Aug 18, 12:33 am, Tomasz Romanowski li...@ruby-forum.com wrote: Rails comes with 3 development environments already ready to go, look database.yml.  In development and testing, all classes are always reloaded. This does not seem to be true. In my example above, if a class does not

[Rails] Arel: Mathematical arithmic on columns

2010-08-17 Thread Dykam
It's hard to explain, so I'll just write down what I have currently: table.project(sum(`#{table.name}`.`#{table[:column_1].name}` * `#{table.name}`.`#{table[:column_2].name}`)) I like to sanitize this and leave out as much raw sql as possible, and have multiple ideas/suggestions which may

[Rails] Re: Student-course system

2010-08-17 Thread Prash Padm
Please guys reply. -- 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-t...@googlegroups.com. To unsubscribe from this group, send email to

[Rails] Re: Extending ActiveRecords in Rails 3

2010-08-17 Thread Bharat Ruparel
Problem solved. Moved the file into: Rails.root/config/initializers directory and it worked. Bharat -- 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

[Rails] Delete link in Rails 3

2010-08-17 Thread Bharat Ruparel
Closing in steadily on my Rails 3 upgrade. I can see the finish line. A few more wrinkles to iron out. My Rails app uses jQuery and Haml. I downloaded the rails.js and put it in my application.html.haml as I show below: !!! %html{:lang = en} %head %meta{http-equiv=Content-Type,

[Rails] [Rails 3] remote_function ?

2010-08-17 Thread Erwin
Is the remote_function still valid in Rails 3 as it seems many of the Prototype helpers have been replaced ? (link_to_remote, ...) where can I find any link on it ? not in the standard doc I guess .. thanks for you feedback -- You received this message because you are subscribed to the

[Rails] Re: How to use local javascript library for development and externally hosted for production?

2010-08-17 Thread lexer
Thanks guys. That was really helpful! -- 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-t...@googlegroups.com. To unsubscribe from this group, send email to

[Rails] auth logic - password confirmation

2010-08-17 Thread oliver torres
Hi, newbie here. :) i have this form on a test rails app: % form_for @user do |f| % %= f.error_messages % p %= f.label :username %br / %= f.text_field :username % /p p %= f.label :email %br / %= f.text_field :email % /p p %= f.label :password %br / %=

Re: [Rails] no route matches ..... for form_remote_tag

2010-08-17 Thread Greg Donald
On Tue, Aug 17, 2010 at 6:29 PM, Tomasz Romanowski li...@ruby-forum.com wrote: I get an error: No route matches {:controller = :controller, :action=add_groups}  when loading a form under users containing: % form_remote_tag :url = { :controller = :users, :action = :add_groups } do %  

Re: [Rails] auth logic - password confirmation

2010-08-17 Thread Greg Donald
On Tue, Aug 17, 2010 at 9:58 PM, oliver torres senortow...@gmail.com wrote: I am following this railscast here http://media.railscasts.com/videos/160_authlogic.mov Half way he changes password_field and also ads password_confirmation and it works great in the video but for me i get this error

Re: [Rails] [Rails 3] remote_function ?

2010-08-17 Thread Greg Donald
On Tue, Aug 17, 2010 at 9:27 PM, Erwin yves_duf...@mac.com wrote: Is  the remote_function still valid in Rails 3 as it seems many of the Prototype helpers have been replaced ?  (link_to_remote, ...) where can I find any link on it ?  not in the standard doc I guess .. %= link_to 'foo',

[Rails] Re: First Test Failures: Anything Obvious?

2010-08-17 Thread Terry Michaels
Colin Law wrote: On 17 August 2010 06:31, Gintautas Šimkus dihita...@gmail.com wrote: Try to save the object first and then check for validity. I don't think that is right, for a start it will not save if it is invalid. Colin The point of the unit test is make sure the object /is/

[Rails] Re: First Test Failures: Anything Obvious?

2010-08-17 Thread Terry Michaels
Terry Michaels wrote: # cat app/models/recording.rb class Recording ActiveRecord::Base validate :title, :speaker, :date_of_event, :file, :presence = true validate :title, :file, :uniqueness = true end Wait, double checked the book... the method is supposed to be validates, not

  1   2   >