Re: [Rails] how to use activemodel collection.build for a has_many :through association

2013-07-23 Thread Colin Law
On 21 July 2013 18:28, James Gray zaa...@gmail.com wrote: Hi all, In my controller I am doing the following to populate a nested form for a has_many through association: def new @specification = Specification.new Component.find_each.each do |component|

Re: [Rails] Does anyone develop on Mac and deploy on *BSD?

2013-07-23 Thread Colin Law
On 23 July 2013 02:35, jmcguckin mcguc...@gmail.com wrote: I have many questions... Well ask them, but best one at a time so that threads do not become interleaved. Colin. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To unsubscribe

[Rails] How to handle exception that is generated in rack middleware before it reach rails app?

2013-07-23 Thread drchanimal
I know that we can use config.exception_app to set up custom exception handling and also use rescue_from. However, I have an issue that there is malformed request (testing generated request) that caused Rails Rack middleware to throw an exception when Rack's parse_query method. Here is the

Re: [Rails] Re: How to create first user for sign in using devise

2013-07-23 Thread Emil S
The user actually uses the email ID and can remember it . I can never remember my usernames , usually. Also forgot password becomes easy with email ID's . But then again, to each, his own. On 22 July 2013 21:09, Robert Walker li...@ruby-forum.com wrote: Emil S. wrote in post #1116233: I use

Re: [Rails] how to use activemodel collection.build for a has_many :through association

2013-07-23 Thread Colin Law
On 23 July 2013 08:23, Colin Law clan...@googlemail.com wrote: On 21 July 2013 18:28, James Gray zaa...@gmail.com wrote: Hi all, In my controller I am doing the following to populate a nested form for a has_many through association: def new @specification = Specification.new

Re: [Rails] how to use activemodel collection.build for a has_many :through association

2013-07-23 Thread Colin Law
On 21 July 2013 18:28, James Gray zaa...@gmail.com wrote: Hi all, In my controller I am doing the following to populate a nested form for a has_many through association: def new @specification = Specification.new Component.find_each.each do |component|

[Rails] Re: Re: How to create first user for sign in using devise

2013-07-23 Thread Robert Walker
Emil S. wrote in post #1116325: The user actually uses the email ID and can remember it . I can never remember my usernames , usually. Also forgot password becomes easy with email ID's . But then again, to each, his own. Yes forgot password is easy that way. It's also easy for the hacker who

Re: [Rails] Re: How to create first user for sign in using devise

2013-07-23 Thread Tamara Temple
On Jul 23, 2013, at 3:39 AM, Emil S emil.so...@gmail.com wrote: The user actually uses the email ID and can remember it . I can never remember my usernames , usually. Also forgot password becomes easy with email ID's . But then again, to each, his own. What happens when the user wants

[Rails] User roles, authorisation, on specific projects

2013-07-23 Thread alex
Hello, Currently I am working on a app, so far I have User (with devise) which are able to create projects. So, if user1 create project A and project B I want him, to be able to assign user2 with role admin on project A, and user2 with moderator admin on project B. I was thinking in creating

[Rails] Re: Does anyone develop on Mac and deploy on *BSD?

2013-07-23 Thread Alan Elliott
On Monday, July 22, 2013 9:35:50 PM UTC-4, jmcguckin wrote: I have many questions... Joe Yes. Deploy to FreeBSD, Apache2, Passenger Phusion and PostgreSQL -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To unsubscribe from this group

[Rails] New web server suggestions

2013-07-23 Thread Rob Daniels
I've been approved for a new Rails web server - any suggestions on hardware, OS setup? Rob -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To unsubscribe from this group and stop receiving emails from it, send an email to

Re: [Rails] Using :group with #count generating bad SQL in Postgres

2013-07-23 Thread Carlos Figueiredo
Your query is wrong... You need group all columns you show that arent the result of an aggregate function... So your group would be group('titles.*') Em 22/07/2013 18:22, yaw yawboaky...@gmail.com escreveu: Rails 4.0.0, Ruby 2.0 class Title ... ... has_many :comments def

[Rails] Re: How to clear ActiveRecord query cache on associations with dynamic table

2013-07-23 Thread Arnaud M.
javinto wrote in post #1097693: Unfortunately the Model.uncached block does not work. I tried ActiveRecord::Base.connection.disable_query_cache! and ActiveRecord::Base.connection.clear_query_cache without any luck. So, it's not the query cache. It looks like some sort of association

[Rails] Re: User roles, authorisation, on specific projects

2013-07-23 Thread alex
On Tuesday, July 23, 2013 1:52:23 PM UTC+1, alex wrote: Hello, Currently I am working on a app, so far I have User (with devise) which are able to create projects. So, if user1 create project A and project B I want him, to be able to assign user2 with role admin on project A, and

[Rails] eclipse 3rdrail db migration wizard fails

2013-07-23 Thread brian sur
Hello, I am attempting to do a new db migration on an existing project however when I try to run the migration wizard it fails with the following error in my console window. script/generate migration --force tests Unable to locate the Ruby interpreter. Please configure one via 'Window |

Re: [Rails] How to clear ActiveRecord query cache on associations with dynamic table

2013-07-23 Thread Jan Verhoek
Unfortunately not. We redesigned the whole concept. Certainly not ideal, but that was the only way around. I did not try it out in Rails 4 though which might be worth a try. Good luck! Op 23 jul. 2013, om 17:51 heeft Arnaud M. li...@ruby-forum.com het volgende geschreven: javinto wrote in

Re: [Rails] Using :group with #count generating bad SQL in Postgres

2013-07-23 Thread Yaw Boakye elGran
Can you write the right (no pun intended) query here? Thanks On Tue, Jul 23, 2013 at 12:36 PM, Carlos Figueiredo carlos.figueired...@gmail.com wrote: Your query is wrong... You need group all columns you show that arent the result of an aggregate function... So your group would be

[Rails] Re: How to clear ActiveRecord query cache on associations with dynamic table

2013-07-23 Thread Arnaud M.
Jan Verhoek wrote in post #1116383: Unfortunately not. We redesigned the whole concept. Certainly not ideal, but that was the only way around. I did not try it out in Rails 4 though which might be worth a try. Good luck! Op 23 jul. 2013, om 17:51 heeft Arnaud M. li...@ruby-forum.com het

[Rails] capybara tests always returning true

2013-07-23 Thread andreo
Hi guys, I am using a test setup with rspec (2.8.0) , capybara (2.0.2), selenium-webdriver (2.27.2), rails 3.0.20 and ruby 1.8.7 My problem is that every request test I have doing something like: page.should have_content(random string) is returning always true, even though the page has no

[Rails] Re: how to use activemodel collection.build for a has_many :through association

2013-07-23 Thread Matt Jones
On Sunday, 21 July 2013 13:28:38 UTC-4, James Gray wrote: Hi all, In my controller I am doing the following to populate a nested form for a has_many through association: def new @specification = Specification.new Component.find_each.each do |component|

Re: [Rails] Using :group with #count generating bad SQL in Postgres

2013-07-23 Thread Carlos Figueiredo
def self.order_by_number_of_comments_descending select('titles.id, titles.name, titles.whatever, count(comments.id) AS comments_count'). joins(:comments). group('titles.id, titles.name, titles.whatever'). order('comment_count DESC') end Assuming titles model is like (id, name,

Re: [Rails] Using :group with #count generating bad SQL in Postgres

2013-07-23 Thread Carlos Figueiredo
Sorry... Are there more columns on titles entity? If yes... the problem is that you tried to show columns you weren't grouping... and on postgresql it blows an exception... but if there is only one column on titles... (titles.id) so, I can't figure out what's the problem you mentioned... What

Re: [Rails] eclipse 3rdrail db migration wizard fails

2013-07-23 Thread Colin Law
On 23 July 2013 17:31, brian sur li...@ruby-forum.com wrote: Hello, I am attempting to do a new db migration on an existing project however when I try to run the migration wizard it fails with the following error in my console window. script/generate migration --force tests Unable to locate

[Rails] Re: eclipse 3rdrail db migration wizard fails

2013-07-23 Thread brian sur
Colin Law wrote in post #1116404: On 23 July 2013 17:31, brian sur li...@ruby-forum.com wrote: I have already specified Generic Ruby Located at: C:\Ruby200-x64\bin\ruby.exe I also tried Generic Ruby Located at: C:\Ruby187\bin\ruby.exe What do you mean you tried them? What happens if you

Re: [Rails] Re: eclipse 3rdrail db migration wizard fails

2013-07-23 Thread Colin Law
On 23 July 2013 20:32, brian sur li...@ruby-forum.com wrote: I made some progress, I removed the 187 interpreter I then re-added it and my migration ran. However I had auto build checked and now its been building at 4% for 2 hours. I have read other had this issue as well but I have not found

[Rails] Re: Re: eclipse 3rdrail db migration wizard fails

2013-07-23 Thread brian sur
Colin Law wrote in post #1116406: On 23 July 2013 20:32, brian sur li...@ruby-forum.com wrote: I made some progress, I removed the 187 interpreter I then re-added it and my migration ran. However I had auto build checked and now its been building at 4% for 2 hours. I have read other had this

Re: [Rails] Re: Re: eclipse 3rdrail db migration wizard fails

2013-07-23 Thread Colin Law
On 23 July 2013 20:42, brian sur li...@ruby-forum.com wrote: Colin Law wrote in post #1116406: On 23 July 2013 20:32, brian sur li...@ruby-forum.com wrote: I made some progress, I removed the 187 interpreter I then re-added it and my migration ran. However I had auto build checked and now its

[Rails] [ANN] Rails 3.2.14 has been released!

2013-07-23 Thread Rafael Mendonça França
Hi everyone, I am happy to announce that Rails 3.2.14 has been released. This is a bug fix release and includes more than 150 commits. I also want to announce that the next 3.2.x release, 3.2.15, will be the **last bug fix release of this family**. After it we will only release security fixes.

[Rails] My Weird error

2013-07-23 Thread João Pereira
Hi, I'm getting this error while deploying to a dev machine with cap:deploy executing cd -- /home/ubuntu/deployments/appreleases/20130723233947 RAILS_ENV=production RAILS_GROUPS=assets rake assets:precompile servers: [ec2-54-229-75-254.eu-west-1.compute.amazonaws.com]

[Rails] My Weird error

2013-07-23 Thread João Pereira
Hi, I'm getting this error while deploying to a dev machine with cap:deploy executing cd -- /home/ubuntu/deployments/ appreleases/20130723233947 RAILS_ENV=production RAILS_GROUPS=assets rake assets:precompile servers: [serverhttp://ec2-54-229-75-254.eu-west-1.compute.amazonaws.com ]

Re: [Rails] Using :group with #count generating bad SQL in Postgres

2013-07-23 Thread Yaw Boakye elGran
There are at least 2 problems with how you recommend the query to be written: 1. Why would titles.* work in regular SQL but not in Rails' selectmethod? What would be the case if I have 100 columns on the titles table? 2. During grouping, the normal SQL requirement is to group on a column

Re: [Rails] Using :group with #count generating bad SQL in Postgres

2013-07-23 Thread Scott Ribe
On Jul 23, 2013, at 6:28 PM, Yaw Boakye elGran yawboaky...@gmail.com wrote: • During grouping, the normal SQL requirement is to group on a column that is on both tables. As far as I know, grouping can't be done on two tables when they don't a common column. In your group call, only

[Rails] Re: Images to pdf

2013-07-23 Thread danny thyui
I do this almost daily. I use a PDF converter driver found on the internet . Install it and it becomes a selectable converter option.Then you can convert PDFs to many forms in any program at all, including Adobe Acrobat . Just open a PDF, select convert, and choice a form you want,then you

[Rails] where to add action when getting started with rails

2013-07-23 Thread Night School
Hey there. I'm a complete noob when it comes to Rails, and Ruby for that matter. I've been trying to make my way through the Getting Started with Rails page on the RoR Guides site (http://guides.rubyonrails.org/getting_started.html). In section 5.7 of that page it says the following: If you

[Rails] Re: Does anyone develop on Mac and deploy on *BSD?

2013-07-23 Thread jmcguckin
Ok, I'm totally clueless on how to get my finished app onto the NetBSD platform. - Do I re-install Rails, Ruby, etc manually or is there some automated way to deploy. - Do I need to tar up the Rails directory with my application and copy it over manually? - What about periodic updates?

Re: [Rails] where to add action when getting started with rails

2013-07-23 Thread Dheeraj Kumar
Rails guides are merely guides to using various features of rails, and not a guide to learning rails from a beginner's POV. For that, I highly recommend http://ruby.railstutorial.org/ruby-on-rails-tutorial-book, which is a free online book. -- Dheeraj Kumar On Wednesday 24 July 2013 at 9:17

[Rails] Postgres adapter misconfigured on Linux?

2013-07-23 Thread Benjamin Nash
I've written a simple Rails migration that adds an index to an existing Postgres table: class AddIndexToEvents ActiveRecord::Migration def change add_index :sf_events, :account_id end end However, when I run the migration, it fails due to a syntax error on the CREATE INDEX line.

[Rails] [JOBS] Ruby on Rails Developer; Boston, MA - full time

2013-07-23 Thread Carol Taylor
My client is a flourishing, integrated global marketing agency with offices all over the world. We work with amazing Fortune 1000 brands that are household names. Project work runs the gamut - from microsites, digital installations and social media to online videos, responsive design and