[Rails] Help with single page application structure

2013-04-03 Thread Johan Vauhkonen
I'm planning on creating a single page application using AngularJS on the client side. I'm not sure if I should use Rails as it is, or the Rails API gem or some other solution. Anyone got any suggestions on how you structured your application? Should I be using the asset pipeline? Or should

[Rails] Help with error messages

2013-04-03 Thread Konstantinos Georgokitsos
Hiall, Please bear with me as I am new to rails. I have the following problem: I have 2 models, Client and Product. Product is dependent, and as such, within the Client show view I created a Product creation form, to create products that belong to a client. After successful or unsuccessful

[Rails] Re: rails source fields_for has an options hash not defined anywhere

2013-04-03 Thread Frederick Cheung
On Wednesday, April 3, 2013 6:21:59 AM UTC+1, eggie5 wrote: I want to know this too. Did you find out? That fields_for method is an instance method of FormBuilder, which has an attr_accessor :options Fred On Wednesday, March 21, 2012 2:12:09 PM UTC-7, John Merlino wrote: Hey all, I

[Rails] Mysql::Error: MySQL server has gone away

2013-04-03 Thread keerthi priya
Hello everyone, I am trying to create reports and the batch has 750 students. with i trying to create report for that batch i am getting this error in my production . How to solve this thing. kindly help me thanks in advance. ActiveRecord::StatementInvalid (Mysql::Error: MySQL server has gone

Re: [Rails] Mysql::Error: MySQL server has gone away

2013-04-03 Thread Colin Law
On 3 April 2013 10:31, keerthi priya emailtokeerthipr...@gmail.com wrote: Hello everyone, I am trying to create reports and the batch has 750 students. with i trying to create report for that batch i am getting this error in my production . How to solve this thing. kindly help me thanks in

[Rails] [JOB] Senior Rails Developer, Hoboken, NJ

2013-04-03 Thread OSS
This is a full time, on-site, salaried Senior Rails Developer position located in Hoboken, NJ paying $150,000-$160,000 a year depending on experience + benefits + relo if required. No telecommuting allowed. US Citizens or Green Card holders only please. Local candidates preferred, but client

[Rails] validates uniqueness scope allow_blank/allow_nil - validation error

2013-04-03 Thread Lephyrius
I have this in a model: class GenreBadge ActiveRecord::Base belongs_to :game, counter_cache: :genre_badges_count, touch: true belongs_to :genre validates :game_id, uniqueness: {scope: :genre_id}, allow_blank: true end When I get one existing genre badge genre_badge =

[Rails] strange behavior with active relation any? method

2013-04-03 Thread John Merlino
In console, I run the following and any? returns true: drivers = Driver.select(drivers.*, drivers.id).joins([:reports, :driving_habits]).where(extract(MONTH FROM reports.time) = ? AND extract(YEAR FROM reports.time) = ?, 3, 2013).uniq.order(drivers.id asc).page(2).per(1) drivers.any? = true This

Re: [Rails] strange behavior with active relation any? method

2013-04-03 Thread Colin Law
On 3 April 2013 20:58, John Merlino stoici...@aol.com wrote: In console, I run the following and any? returns true: drivers = Driver.select(drivers.*, drivers.id).joins([:reports, :driving_habits]).where(extract(MONTH FROM reports.time) = ? AND extract(YEAR FROM reports.time) = ?, 3,

Re: [Rails] invoking helper method in controller and view breaks the separation of concern?

2013-04-03 Thread tamouse mailing lists
I am unfamiliar with this concept of separating helper functions. In the interest of DRY code, what you're doing makes complete sense to me. On Tue, Apr 2, 2013 at 4:54 PM, John Merlino stoici...@aol.com wrote: I came across some posts which postulate that it's undesirable to share helper

Re: [Rails] Re: How to set exception in client side validation gem

2013-04-03 Thread tamouse mailing lists
On Tue, Apr 2, 2013 at 6:31 PM, Barry burm...@mail.ru wrote: Ok guys, finally gem caused several issues, which was hard to debug, so finally I just set up my own jquery validation, and it was no so hard as I imagined. Like this solution, not always gems are suitable, and it was good practice)

Re: [Rails] Help with single page application structure

2013-04-03 Thread tamouse mailing lists
On Tue, Apr 2, 2013 at 8:43 AM, Johan Vauhkonen johan.vauhko...@gmail.com wrote: I'm planning on creating a single page application using AngularJS on the client side. I'm not sure if I should use Rails as it is, or the Rails API gem or some other solution. Anyone got any suggestions on how

[Rails] Re: invoking helper method in controller and view breaks the separation of concern?

2013-04-03 Thread Robert Walker
John Merlino wrote in post #1104251: As you can see, my view helper makes use of the sort_column and sort_direction methods to check the current values in the params hash to determine how to render the links. So those methods have importance both in the controller and view layer. So it would

Re: [Rails] Re: invoking helper method in controller and view breaks the separation of concern?

2013-04-03 Thread Julian Leviston
On 04/04/2013, at 10:46 AM, Robert Walker li...@ruby-forum.com wrote: As a developer who has worked with a number of MVC frameworks I really don't consider Rails to be a very pure MVC. Views and controllers are more tightly coupled to each other than in other MVC systems I've worked with.

[Rails] Help me with :only in Route of Rails

2013-04-03 Thread haxuan lac
I'm learning with routing in rails from : http://guides.rubyonrails.org/routing.html and I have first code : resources :users and last code: resources :users, :only = [:index, :show] and have error : undefined method `edit_user_path' for ##Class:0x2d9d068:0x53dacb0 can you help me this