Re: [Rails] I18n.t('countries.NO') broken?

2012-04-02 Thread Rob Biedenharn
There are optimizations in YAML for YES and NO. Define it this way: en: countries: DE: Germany NO: Norway US: USA and it should work for you. -Rob On Mar 31, 2012, at 7:19 AM, Sven Schwyn wrote: Hi I've tried this on a virgin Rails 3.2.2 app. If you put the translations

[Rails] uninitialized constant UserController

2012-04-02 Thread Soichi Ishida
Rails 3.1.3 I am trying to create an administrator page. 'User' table has a field, admin:boolean, then user having 'admin=true' can only access it, as you can imagine. But accessing http://localhost:3000/admin/user gives an error, uninitialized constant UserController I have

[Rails] Finding the execution time

2012-04-02 Thread Mahes karthick
I had developed one Web application using ROR. Application consists of more than 100 pages. I need to find out the execution time of overall application ,without browsing all pages in the browser manually.how to find the execution time ? shall i use shoulda testing framework? -- Posted via

[Rails] Invoking one controller's methods from other controller

2012-04-02 Thread Pallav_bfs
I have a controller (employee) with it's model and view. Now I need to write another controller (emp) which would not have any model or view. This emp controller should be able to invoke all the methods of employee controller.And eventually be able to represent all the relevant information. I

[Rails] Re: Persistent Cookies and Sessions

2012-04-02 Thread David Moeller
One bump. I have not heard from anyone in 19 hours. Thanks. -- 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@googlegroups.com. To

Re: [Rails] Invoking one controller's methods from other controller

2012-04-02 Thread Colin Law
On 2 April 2012 11:17, Pallav_bfs spalla...@gmail.com wrote: I have a controller (employee) with it's model and view. Now I need to write another controller (emp) which would not have any model or view. This emp controller should be able to invoke all the methods of employee controller.And

[Rails] Re: controller missing - locale

2012-04-02 Thread Christopher Jones
Hi, I am receiving the following error: ArgumentError missing :controller Rails.root: C:/Users/Christopher/Favorites/safety/safety 11/games Application Trace | Framework Trace | Full Trace config/routes.rb:4:in `block (2 levels) in top (required)' config/routes.rb:3:in `block in top

[Rails] Re: controller missing - locale

2012-04-02 Thread Christopher Jones
No worries, solved. -- 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@googlegroups.com. To unsubscribe from this group, send email to

[Rails] asset precompilation is crashing ruby 1.9.3-p125

2012-04-02 Thread Jodi
Hey folks, I'm tracking a periodic ruby crash - about 1 in 10 - when compiling assets RAILS_ENV=new_staging bundle exec rake assets:precompile --trace Debian Lenny and Debian Squeeze 6.0.4 https://gist.github.com/2254457 Our code base is quite large - I'm working on a test case to submit to

[Rails] New Rails User stuck on tutorial = Updating Posts/Mass Assignment

2012-04-02 Thread aekwolf
Hey guys, I've just started with Rails. I'm going through the getting started tutorial, and I'm running into this error: ActiveModel::MassAssignmentSecurity::Error in PostsController#update I know it has to do with the new update and the whitelist attributes, but I don't have the first idea how to

[Rails] Re: includes and eager loading not working in simple setup

2012-04-02 Thread Frederick Cheung
On Apr 2, 3:14 am, jenna_s jenna.sim...@gmail.com wrote: Hi Peter, How did you know that?! Yes, indeed there are 3 SQL queries: Message Load (0.5ms)  SELECT `messages`.* FROM `messages` WHERE (from_user_id = 3 AND to_user_id = '2' OR to_user_id = 3 AND from_user_id = '2') ORDER BY

Re: [Rails] New Rails User stuck on tutorial = Updating Posts/Mass Assignment

2012-04-02 Thread Tom Meinlschmidt
add attr_accessible :my_attribute_name. to your model.rb file tom On Apr 2, 2012, at 5:33 , aekwolf wrote: Hey guys, I've just started with Rails. I'm going through the getting started tutorial, and I'm running into this error: ActiveModel::MassAssignmentSecurity::Error in

Re: [Rails] Invoking one controller's methods from other controller

2012-04-02 Thread Jeffrey L. Taylor
Quoting Pallav_bfs spalla...@gmail.com: I have a controller (employee) with it's model and view. Now I need to write another controller (emp) which would not have any model or view. This emp controller should be able to invoke all the methods of employee controller.And eventually be able to

[Rails] Strictly related models

2012-04-02 Thread Serafino Picozzi
Hi, I have two models, Page and MenuItem, where Page belongs_to MenuItem . When I delete a page I need to delete also its MenuItem, and vice versa. The problema is that I can't put a :dependent = :destroy on both relations because (obviously) this gives an error. Is there a clean way to solve

Re: [Rails] Strictly related models

2012-04-02 Thread Colin Law
On 2 April 2012 17:25, Serafino Picozzi li...@ruby-forum.com wrote: Hi, I have two models, Page and MenuItem, where Page belongs_to MenuItem . When I delete a page I need to delete also its MenuItem, and vice versa. The problema is that I can't put a :dependent = :destroy on both relations

Re: [Rails] Persistent Cookies and Sessions

2012-04-02 Thread Walter Lee Davis
GIYF: Search term was 'rails session config', second result seems to indicate that this expire_after option is no longer in the Active Record Session: http://stackoverflow.com/questions/5860950/setting-session-timeout-in-rails-3 Walter On Apr 1, 2012, at 12:44 PM, David Moeller wrote: I'm

[Rails] active admin saving selection from collection_select and passing to controller

2012-04-02 Thread ruby LED
hi i am using active admin for my app i have a partial with a drop down list where the menu and recipe are populated this page is to group the recipe in a menu _menu_recipe.html.erb %= semantic_form_for [:admin, @menu_recipe] do |f| % p %= f.collection_select :recipe_id,

[Rails] paginate with multiple criteria

2012-04-02 Thread Christopher Jones
I have pagination on my users table at the moment which works fine as I only have one search feature for users. But I now wish to add pagination to my games table but not sure how to implement it as I have 5 search features for games. I was wondering how I would go about adding the pagination to

[Rails] Re: Persistent Cookies and Sessions

2012-04-02 Thread David Moeller
Walter Davis wrote in post #1054653: GIYF: Search term was 'rails session config', second result seems to indicate that this expire_after option is no longer in the Active Record Session: http://stackoverflow.com/questions/5860950/setting-session-timeout-in-rails-3 Walter Thanks for the

[Rails] Problem: jruby -S bundle install - tries to build native extension of yajl-ruby

2012-04-02 Thread Jedrin
I am trying to build a rails app I wrote in JRuby. When I run bundle install it errors out on yajl-ruby trying to build it as a native extension. I think it must have some dependency with a different gem. How can I figure out what is causing it to want to use that gem or how to work around it

[Rails] Re: paginate with multiple criteria

2012-04-02 Thread Damjan Rems
Christopher Jones wrote in post #1054663: I have pagination on my users table at the moment which works fine as I only have one search feature for users. But I now wish to add pagination to my games table but not sure how to implement it as I have 5 search features for games. I was wondering

Re: [Rails] Problem: jruby -S bundle install - tries to build native extension of yajl-ruby

2012-04-02 Thread Hassan Schroeder
On Mon, Apr 2, 2012 at 11:42 AM, Jedrin jrubia...@gmail.com wrote:  I am trying to build a rails app I wrote in JRuby. When I run bundle install it errors out on  yajl-ruby trying to build it as a native extension. I think it must have some dependency with a different gem. How can I figure

[Rails] Re: asset precompilation is crashing ruby 1.9.3-p125

2012-04-02 Thread Jodi
I've filed the following bug report with ruby-core http://bugs.ruby-lang.org/issues/6246 On Monday, 2 April 2012 11:04:51 UTC-4, Jodi wrote: Hey folks, I'm tracking a periodic ruby crash - about 1 in 10 - when compiling assets RAILS_ENV=new_staging bundle exec rake assets:precompile

[Rails] Re: New Rails User stuck on tutorial = Updating Posts/Mass Assignment

2012-04-02 Thread aekwolf
Thank you!! On Apr 2, 11:57 am, Tom Meinlschmidt to...@meinlschmidt.com wrote: add attr_accessible :my_attribute_name. to your model.rb file tom On Apr 2, 2012, at 5:33 , aekwolf wrote: Hey guys, I've just started with Rails. I'm going through the getting started tutorial, and

[Rails] Re: includes and eager loading not working in simple setup

2012-04-02 Thread jenna_s
Ok... I had no idea. I always thought that if you have an includes,that will automatically resolve to a join because otherwise this might result in the N+1 problem. I guess I need to read up about it some more. One final question: when I return some_user.messages(another_user.id) to json from my

[Rails] Re: Error installing Rails on Ubuntu 11.10 (Gem::DependencyError)

2012-04-02 Thread YogiZoli
Hi, Colin is right, using RVM has lots of advantages! You can have multiple Rubies and Gem versions, Gemsets for projects, etc. Highly recommend because without it you're gonna have a tone of Gem version problems later. We made a 1 line script for Ubuntu which installs Wayne's RVM, with RVM

Re: [Rails] Re: includes and eager loading not working in simple setup

2012-04-02 Thread Colin Law
On 2 April 2012 22:03, jenna_s jenna.sim...@gmail.com wrote: Ok... I had no idea. I always thought that if you have an includes,that will automatically resolve to a join because otherwise this might result in the N+1 problem. I guess I need to read up about it some more. One final question:

[Rails] Re: Strictly related models

2012-04-02 Thread Serafino Picozzi
There is no reverse, it's a regular has_one belongs_to association. i just wanto to be able to delete both records either by deleting a page from the pages_controller or by deleting a menu_item from the menu_items_controller. in both cases both the page and the menu item need to be deleted

[Rails] Pessimistic locking locks the entire table?

2012-04-02 Thread PierreW
Hi guys, I must be missing something obvious with pessimistic locking. Here is what I do (Rails 2.3, mySQL): In my Foo model: def test Foo.transaction do lock = UpdateLockForFoo.find_by_foo_id(self.id, :lock = true) sleep 30 end end For each Foo model, I have an UpdateLockForFoo.

Re: [Rails] Re: Strictly related models

2012-04-02 Thread Hassan Schroeder
On Mon, Apr 2, 2012 at 3:10 PM, Serafino Picozzi li...@ruby-forum.com wrote: There is no reverse, it's a regular has_one belongs_to association. i just wanto to be able to delete both records either by deleting a page from the pages_controller or by deleting a menu_item from the

[Rails] Re: Re: Strictly related models

2012-04-02 Thread Serafino Picozzi
Hassan Schroeder wrote in post #1054715: On Mon, Apr 2, 2012 at 3:10 PM, Serafino Picozzi li...@ruby-forum.com wrote: There is no reverse, it's a regular has_one belongs_to association. i just wanto to be able to delete both records either by deleting a page from the pages_controller or by

[Rails] Re: Problem: jruby -S bundle install - tries to build native extension of yajl-ruby

2012-04-02 Thread Jedrin
Assuming you're using rvm, create a separate gemset and do your `bundle install` with MRI and then examine the Gemfile.lock that's been built. Thanks, but I am on windows. I found a FAQ that says RVM doesn't run on windows. -- You received this message because you are subscribed to the

Re: [Rails] Re: Re: Strictly related models

2012-04-02 Thread Hassan Schroeder
On Mon, Apr 2, 2012 at 3:48 PM, Serafino Picozzi li...@ruby-forum.com wrote: There is no reverse, it's a regular has_one belongs_to association. i just wanto to be able to delete both records either by deleting a page from the pages_controller or by deleting a menu_item from the

Re: [Rails] Re: Problem: jruby -S bundle install - tries to build native extension of yajl-ruby

2012-04-02 Thread Hassan Schroeder
On Mon, Apr 2, 2012 at 3:53 PM, Jedrin jrubia...@gmail.com wrote:  Thanks, but I am on windows. I found a FAQ that says RVM doesn't run on windows. I believe there's an equivalent for Windows, or you could use a VM to isolate the experiment from your regular installation, but that's really

[Rails] Re: Strictly related models

2012-04-02 Thread Serafino Picozzi
Probably then it's related to the awesome_nested_set plugin... This sucks it's already the second plugin I'm trying to use (the other is cancan) that breaks some core functionality -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google

[Rails] Re: Unable to deploy to Apache

2012-04-02 Thread Kal
Hi Walter, Again, my apologies for the delay in reply. I'm more confused now than before, so it took some time to poke around. Firstly, I don't run a separate development and production server. Does that matter? Installed are rake (0.9.2.2) and bundler (1.0.21). I have not run bundle install

[Rails] Re: Unable to deploy to Apache

2012-04-02 Thread Kal
Typo: product listing are NOT displayed :( On Apr 2, 8:39 pm, Kal calcr...@gmail.com wrote: Hi Walter, Again, my apologies for the delay in reply.  I'm more confused now than before, so it took some time to poke around. Firstly, I don't run a separate development and production server.

[Rails] Re: Unable to deploy to Apache

2012-04-02 Thread Kal
Hi L, therubyracer (0.9.9) is already installed :( Thanks Anyway :) ~Kal On Mar 31, 7:51 am, Firstname L. li...@ruby-forum.com wrote: Ok this might sound funny but , this problem is usually caused by lack of javascript libraries in your rails setup so i would recommend you to do this .

Re: [Rails] Re: Strictly related models

2012-04-02 Thread Hassan Schroeder
On Mon, Apr 2, 2012 at 4:19 PM, Serafino Picozzi li...@ruby-forum.com wrote: Probably then it's related to the awesome_nested_set plugin... Well, I just added awesome_nested_set (as a gem) to my little test app, and it didn't have any effect on using :dependent = :destroy. You might want to

Re: [Rails] Re: Unable to deploy to Apache

2012-04-02 Thread Walter Lee Davis
On Apr 2, 2012, at 8:39 PM, Kal wrote: Hi Walter, Again, my apologies for the delay in reply. I'm more confused now than before, so it took some time to poke around. Firstly, I don't run a separate development and production server. Does that matter? If you start rails with rails

Re: [Rails] Re: Strictly related models

2012-04-02 Thread Walter Lee Davis
On Apr 2, 2012, at 9:06 PM, Hassan Schroeder wrote: On Mon, Apr 2, 2012 at 4:19 PM, Serafino Picozzi li...@ruby-forum.com wrote: Probably then it's related to the awesome_nested_set plugin... Well, I just added awesome_nested_set (as a gem) to my little test app, and it didn't have any

[Rails] Re: Unable to deploy to Apache

2012-04-02 Thread Kal
Hi Walter, Very sorry for the confusion. When I mention server, I'm actually referring to the box, not a service(s). I'm actually running everything from a virtual dedicated server (through GoDaddy.com). I'm not testing any of the aforementioned items on a desktop nor am I deploying to Apache

Re: [Rails] Re: Unable to deploy to Apache

2012-04-02 Thread Walter Lee Davis
On Apr 2, 2012, at 10:15 PM, Kal wrote: Hi Walter, Very sorry for the confusion. When I mention server, I'm actually referring to the box, not a service(s). I'm actually running everything from a virtual dedicated server (through GoDaddy.com). I'm not testing any of the

[Rails] Re: includes and eager loading not working in simple setup

2012-04-02 Thread jenna_s
Great! Thanks everyone for the help. On Apr 2, 2:11 pm, Colin Law clan...@googlemail.com wrote: On 2 April 2012 22:03, jenna_s jenna.sim...@gmail.com wrote: Ok... I had no idea. I always thought that if you have an includes,that will automatically resolve to a join because otherwise