[Rails] Re: Rails 3 with iPhone

2012-01-19 Thread angel david
Javier Quarite wrote in post #1041505: On Wed, Jan 18, 2012 at 6:09 AM, angel david li...@ruby-forum.com wrote: `method_missing' /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.1/lib/action_dispatch/http/parameters.rb:10:in `parameters' What comes before this? Javier Hi Javier..

[Rails] Problem in testing with separate validation of :attachment_file_name

2012-01-19 Thread Aashish Kiran
Using: RSpec, Shoulda, Paperclip (including matchers) Example Model class Example ActiveRecord::Base has_attached_file :attachment validates_attachment_presence :attachment validates_format_of :attachment_file_name, :with = /\.(png|jpe?g)$/ end Example Test require 'spec/helper'

[Rails] Can you extend an association, but only for a specific instance?

2012-01-19 Thread John Feminella
ActiveRecord allows an association to be extended, as in: module FindWeeklyExtension def weekly(start) where(created_at :t1 and created_at :t2, :t1 = start, :t2 = start + 7.days ) end end class Author has_many :posts, :extend = FindWeeklyExtension

[Rails] Rails 3.2.0rc2 Ruby 1.9.3 critical development enviroment performance

2012-01-19 Thread gkc
Hi there, I wonder if anybody else is experiencing this kind of issues, I'm running failry small application in development environment and I'm experiencing REALLY unacceptable performance issues. Below is summary line from development log for my slowest edit action, which is just a nested form:

Re: [Rails] Cannot redirect to nil!

2012-01-19 Thread Colin Law
On 18 January 2012 23:38, muhammad singgih zulfikar ansori m.singgih...@gmail.com wrote: oh sorry, here i attach the complete errors from test: [snip] ActionController::ActionControllerError in LineItemsController#create Cannot redirect to nil! Rails.root:

Re: [Rails] parametes in the URL

2012-01-19 Thread Colin Law
On 19 January 2012 03:12, Daisy Di li...@ruby-forum.com wrote: Dear All, There are two tables one is redemption_list,columns are: id(int),item_id(char(15)),points_required the other one is redemption_location,columns are: id(int),loc_id(char(3)),item_id(char(15)).

Re: [Rails] rails associations

2012-01-19 Thread Colin Law
On 19 January 2012 04:19, Daisy Di li...@ruby-forum.com wrote: Dear all, there are two tables ,one is product, one is location, product has many location, and location belongs to product, all the setting in the models i have done, now in the views/show.html.erb, i want to display the product

[Rails] Rails 3 refuses to clear the cache

2012-01-19 Thread Cyril Lavedrine
Hello, I've recently migrated my application to Rails 3, and I encounter problems with the new system of SQL-caching. I have a 'category' action on my PostsController that I access through a standard *:controller/:action/:id* route ( www.my_app.net/posts/category/something), and runs a query to

[Rails] Re: include and scopes

2012-01-19 Thread Damien Knight
no one? -- 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

Re: [Rails] include and scopes

2012-01-19 Thread Colin Law
On 30 December 2011 10:54, Damien Knight li...@ruby-forum.com wrote: Hi, I recently changed to rails 3 and the chainability for relations(i.e. .where(xxx).order(xxx)) so here's my question: can i use scopes in my includes to avoid 1+n-query problem? i have: class A ActiveRecord::Base  

[Rails] Re: Need some advice on how to start a rails app

2012-01-19 Thread Mohamad El-Husseini
@Colin and @Mike, thank you both, particularly, mike , for the part about devise integration. To wrap up, I would like your opinion whether there any flaws or major disadvantages to my structure. I dropped the organizations table since I think its redundant. This leaves me with the following

[Rails] validation of nested polymorphic class

2012-01-19 Thread Erwin
I have Admin class User class and a polymorphic Profile class class Admin ActiveRecord::Base include ActiveModel::Validations has_one :profile, :as = :profitable accepts_nested_attributes_for :profile validates_associated :profile class User ActiveRecord::Base include

Re: [Rails] validation of nested polymorphic class

2012-01-19 Thread Peter Vandenabeele
On Thu, Jan 19, 2012 at 3:24 PM, Erwin yves_duf...@mac.com wrote: I have Admin class User class and a polymorphic Profile class class Admin ActiveRecord::Base include ActiveModel::Validations has_one :profile, :as = :profitable accepts_nested_attributes_for :profile

[Rails] Could Someone please explain how to repeate my code recursivly?

2012-01-19 Thread Loren
Hi, I am new to programming and following Chris Pines book. There is an exercise in the book to write a method similar to .sort that will arrange an array of string in alphabetical order. I will paste the exercise: OK. So we want to sort an array of words, and we know how to find out which of

[Rails] Re: validation of nested polymorphic class

2012-01-19 Thread Erwin
Thanks Peter .. just a typing error in my post , actually it's well written in the models : has_one :profile, :as = :profitable ( even if profitable would make $$) the params sent from the form submit are OK {.. admin={area_id=1, canAdministrate=0, canManageProject=0, canShootVideo=0,

Re: [Rails] Could Someone please explain how to repeate my code recursivly?

2012-01-19 Thread Scott Ribe
On Jan 19, 2012, at 10:39 AM, Loren wrote: Would you be please so kind to take a look at my code and tell me what am I doing wrong? You're making this far, far, far more complicated than it needs to be. Hint 1: you only need two arrays, sorted unsorted, all the shuffling in out of

[Rails] Multiple Before Filters

2012-01-19 Thread Dan King
I've added two before filters in one of my controllers like so: before_filter :filter_one before_filter :filter_two The first filter (:filter_one) always fires, but the second filter (:filter_two) never does. Anyone know how to make both filters always fire? Thanks. -Dan -- Posted via

Re: [Rails] Multiple Before Filters

2012-01-19 Thread Hassan Schroeder
On Thu, Jan 19, 2012 at 10:23 AM, Dan King li...@ruby-forum.com wrote: I've added two before filters in one of my controllers like so: before_filter :filter_one before_filter :filter_two The first filter (:filter_one) always fires, but the second filter (:filter_two) never does. Anyone know

Re: [Rails] Multiple Before Filters

2012-01-19 Thread Jordan Miller
what version of rails are you using? on 3.1.3 all three of these fire fine for me in my application controller... before_filter :must_login before_filter :must_be_member before_filter :must_be_admin jordan On Jan 19, 2012, at 1:23 PM, Dan King wrote: I've added two before filters

[Rails] Re: Multiple Before Filters

2012-01-19 Thread Mohamad El-Husseini
Could it be that your first filter is preventing the request from reaching your second filter? -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To view this discussion on the web visit

[Rails] map.connect issue with multiple rails apps

2012-01-19 Thread art tav
Hi, I'm having an issue with some routes in my apps, the apps are the same app the only difference is that I use one for testing and the other for production stored in different directories lets say 'test' and 'prod'. The applications work with phusion passenger and their work in a virtual host.

Re: [Rails] map.connect issue with multiple rails apps

2012-01-19 Thread Colin Law
On 19 January 2012 20:42, art tav li...@ruby-forum.com wrote: Hi, I'm having an issue with some routes in my apps, the apps are the same app the only difference is that I use one for testing and the other for production stored in different directories lets say 'test' and 'prod'. The

Re: [Rails] map.connect issue with multiple rails apps

2012-01-19 Thread Colin Law
On 19 January 2012 20:58, Colin Law clan...@googlemail.com wrote: ... I hesitate to reply because I do not fully understand what you are doing so anything I say may be rubbish.  However I believe that the url generated by a commit action of a form (which I think is what you are referring to)

[Rails] Re: map.connect issue with multiple rails apps

2012-01-19 Thread art tav
Colin Law wrote in post #1041687: On 19 January 2012 20:42, art tav li...@ruby-forum.com wrote: form action=/controllerName/ method=post I hesitate to reply because I do not fully understand what you are doing so anything I say may be rubbish. However I believe that the url generated by a

Re: [Rails] Re: map.connect issue with multiple rails apps

2012-01-19 Thread Colin Law
On 19 January 2012 21:50, art tav li...@ruby-forum.com wrote: Colin Law wrote in post #1041687: On 19 January 2012 20:42, art tav li...@ruby-forum.com wrote: form action=/controllerName/ method=post I hesitate to reply because I do not fully understand what you are doing so anything I say

[Rails] redirect_to with a hash instead of parameters

2012-01-19 Thread Peter Hicks
All, I have numerous places in my codebase like this: redirect_to :action = 'schedule_by_uid_and_run_date', :uid = @schedule.first.train_uid, :year = @date.year, :month = @date.month, :day = @date.day I'd like to replace the :year, :month and :day parameters with a hash containing the

[Rails] Re: map.connect issue with multiple rails apps

2012-01-19 Thread art tav
Thirdly, and this is the bit I don't understand and so hope to learn more, why are you specifying the controller name in the action and why the ../ or / on the front? The ../ or / at the beginning are used for being certain that the url it's created from the root of the application, I found

[Rails] Merging URL parameters with form_for ones

2012-01-19 Thread PierreW
Hello! I am using the standard (scaffolded), REST routing. I need to pass external values to my new action for a certain model, and let the user complete the other fields in the standard form_for. My initial idea has been to simply amend the URL like this: .../foos/new?size=4weight=2 Then in

Re: [Rails] Merging URL parameters with form_for ones

2012-01-19 Thread Hassan Schroeder
On Thu, Jan 19, 2012 at 4:19 PM, PierreW wamre...@googlemail.com wrote: I am using the standard (scaffolded), REST routing. I need to pass external values to my new action for a certain model, and let the user complete the other fields in the standard form_for. My initial idea has been to

[Rails] Internal Server Error Mysql2::Error: Lock wait timeout exceeded; try restarting transaction

2012-01-19 Thread John Merlino
Hey all, When running a cucumber test, I get this: Internal Server Error Mysql2::Error: Lock wait timeout exceeded; try restarting transaction: INSERT INTO `users` (`address_1`, `address_2`, `address_3`, `can_receive_sms`, `city`, `completed_terms_on`, `country_id`, `created_at`,

[Rails] Istalling Ruby 1.9.2

2012-01-19 Thread Francesca Krihely
I just installed 1.9.2 on my 2nd machine, but after I installed I checked the version with ruby -v and it sent me 1.8.7 Here's the terminal output...anyone know what's wrong (I have RVM installed): Francescas-MacBook-Air:~ fkrihely$ rvm install 1.9.2 Fetching yaml-0.1.4.tar.gz to

[Rails] Re: Istalling Ruby 1.9.2

2012-01-19 Thread Francesca Krihely
doh! For anyone who is silly like me, After install put rvm use 1.9.2 in the command line and voilla ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.2.0] On Thu, Jan 19, 2012 at 10:24 PM, Francesca Krihely france...@10gen.comwrote: I just installed 1.9.2 on my 2nd machine, but

Re: [Rails] Re: Istalling Ruby 1.9.2

2012-01-19 Thread Javier Quarite
On Thu, Jan 19, 2012 at 10:27 PM, Francesca Krihely france...@10gen.comwrote: doh! For anyone who is silly like me, After install put rvm use 1.9.2 in the command line and voilla ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.2.0] Sometimes its helpful to close the

[Rails] how to pass data from one page to another

2012-01-19 Thread Daisy Di
Dear all, i want to enter quantity ordered in the textfield on product page, then click view location, to view the location of the product ,then choose the location and submit to make a reservation, but i want to know how can i pass quantity ordered from product page to location page. Thanks --