Re: [Rails] Rails 5.0.0.beta3 thinks it is in production mode when it isn't.

2016-03-09 Thread Dave Bell
Colin, thanks for pointing out the fact that each asset, JS and CSS in particular, are being fetched individually, that wouldn't happen with the production asset pipeline running. Strange still about the way images are being handled. By restarting the server, with the asset already placed thi

[Rails] Re: Re: Re: Simple_Form has_many through question

2016-03-09 Thread John Sanderbeck
Colin Law wrote in post #1182071: > OK, I did not realise that you wanted to input a numeric value. The > fact that it is an integer rather than, for example, a text string, is > irrelevant to the form. You just need to use f.input. What you do > with that in the controller, of course, is up to

[Rails] Re: Having trouble with named_scopes for my view

2016-03-09 Thread David Williams
Colin Law wrote in post #1182073: > On 9 March 2016 at 21:51, David Williams wrote: >> "articles"."category_id" = ? ORDER BY "articles"."created_at" DESC >> [["category_id", 1]] >> >> >> I'm getting undefined method `each' for # > > That is because you only have a single Article, not a collection

Re: [Rails] Having trouble with named_scopes for my view

2016-03-09 Thread Colin Law
On 9 March 2016 at 21:51, David Williams wrote: > In my articles model, I created a scope that links categories to their > respective articles posts. When I use the rails console, the method > works perfectly when I query the db. > > article.rb > > scope :category_technology, -> {where(category_id

[Rails] Having trouble with named_scopes for my view

2016-03-09 Thread David Williams
In my articles model, I created a scope that links categories to their respective articles posts. When I use the rails console, the method works perfectly when I query the db. article.rb scope :category_technology, -> {where(category_id: 1)} @articles.category_technology Article Load (0.5ms) SE

Re: [Rails] Re: Re: Simple_Form has_many through question

2016-03-09 Thread Colin Law
On 9 March 2016 at 21:06, John Sanderbeck wrote: > Colin Law wrote in post #1182068: >> On 9 March 2016 at 16:43, John Sanderbeck wrote: >> Firstly please quote the previous message when you reply, this is a >> mailing list not a forum (though you may be accessing it via a forum >> like interface

[Rails] Re: Form is not saving data upon submission

2016-03-09 Thread David Williams
Hassan Schroeder wrote in post #1182051: > On Tue, Mar 8, 2016 at 4:00 PM, David Williams > wrote: > > ?! You're creating a form tag within a form tag - not valid HTML in > any way. And that outer form has no method or action attributes, so > not much is ever going to happen, as you see :-) > > --

[Rails] Re: Re: Simple_Form has_many through question

2016-03-09 Thread John Sanderbeck
Colin Law wrote in post #1182068: > On 9 March 2016 at 16:43, John Sanderbeck wrote: > Firstly please quote the previous message when you reply, this is a > mailing list not a forum (though you may be accessing it via a forum > like interface) so if you do not quote the previous message we have to

Re: [Rails] Re: Simple_Form has_many through question

2016-03-09 Thread Colin Law
On 9 March 2016 at 16:43, John Sanderbeck wrote: > I have watched many tutorials through CodeSchool, Railscasts, and the > site you mentioned. None touch on exactly what I am trying to do. > > I know it's something simple, I just can't find a reference to what I > want to do anywhere. Firstly ple

[Rails] Re: Simple_Form has_many through question

2016-03-09 Thread John Sanderbeck
I have watched many tutorials through CodeSchool, Railscasts, and the site you mentioned. None touch on exactly what I am trying to do. I know it's something simple, I just can't find a reference to what I want to do anywhere. John -- Posted via http://www.ruby-forum.com/. -- You received t

Re: [Rails] Simple_Form has_many through question

2016-03-09 Thread Colin Law
On 9 March 2016 at 14:43, John Sanderbeck wrote: > ... > Needless to say I am new to Rails and am struggling with the syntax. I suggest that before continuing with your own project you work right through a good tutorial such as railstutorial.org, which is free to use online. That will show you t

[Rails] Simple_Form has_many through question

2016-03-09 Thread John Sanderbeck
I am working on a project and I setup a has_many through relationship but am having a hard time figuring out how to display and edit it on a form. What I have is a Training Table, an Organization Table, and a join table called Attendees In Attendees I have the training_id, organization_id, and at

Re: [Rails] Rails 5.0.0.beta3 thinks it is in production mode when it isn't.

2016-03-09 Thread Colin Law
On 8 March 2016 at 23:22, Dave Bell wrote: > I believe a similar thing is happen with my install of Rails 5. It appears > to me that the development environment is attempting to serve assets via the > pipeline. For my experiment I use an image_tag to pull down an image. In > the first load case

Re: [Rails] Form is not saving data upon submission

2016-03-09 Thread Hassan Schroeder
On Tue, Mar 8, 2016 at 4:00 PM, David Williams wrote: > When I click the submit button, the form automatically refreshes the > page. > Started GET > "/articles/new? utf8=%E2%9C%93&authenticity_token=GP%2Fm4GX2Z2CUjuFt5QJOEEcIcEtKzsd9nPGQ6OfmMQn2yiUHqwoGPvzQiu2hSiPK0V8%2Br1r%2F0TfC5zZM26Y2VA%3D%3D

[Rails] Script for http request syntax in rails 5?

2016-03-09 Thread Colin Law
I don't suppose anyone has written a script to update the http request syntax to that required in rails 5 have they? The old format is deprected in 5.0 but will presumably be removed in rails 5.1. The warning is DEPRECATION WARNING: ActionController::TestCase HTTP request methods will accept onl

Re: [Rails] Rails 5.0.0.beta3 thinks it is in production mode when it isn't.

2016-03-09 Thread Colin Law
> ... > At this point I discovered that coffeescript is not a superset of > javascript. I copied the javascript line-for-line into a new coffeescript > file and Rails barfed. I have never used coffeescript, but from the looks > of things, I needed to learn fast. Just for reference, I believe tha

Re: [Rails] Rails 5.0.0.beta3 thinks it is in production mode when it isn't.

2016-03-09 Thread Dave Bell
I believe a similar thing is happen with my install of Rails 5. It appears to me that the development environment is attempting to serve assets via the pipeline. For my experiment I use an image_tag to pull down an image. In the first load case the PNG requested is not present in app/assets/