Re: [Rails-core] Customizable parameter name in routing.

2012-10-08 Thread Godfrey Chan
Pretty sure he meant Pascal On 2012-10-08, at 8:59 PM, Nickolas wrote: > But reasons indicated by Piotr are favourable. Why? > > вторник, 9 октября 2012 г., 1:47:47 UTC+4 пользователь Ryan Bigg написал: > -1 on this also for reasons Piotr explained. > > > > On 09/10/2012, at 8:13, Nickolas

Re: [Rails-core] Customizable parameter name in routing.

2012-10-08 Thread Nickolas
But reasons indicated by Piotr are favourable. Why? вторник, 9 октября 2012 г., 1:47:47 UTC+4 пользователь Ryan Bigg написал: > -1 on this also for reasons Piotr explained. > > > > On 09/10/2012, at 8:13, Nickolas > > wrote: > > It does only half of the job. It changes the content of the param

Re: [Rails-core] Customizable parameter name in routing.

2012-10-08 Thread Nickolas
But why? Reasons explained by Piotr are favourable for this patch. He said that the approach with before_filter is not quite elegant and he'd like to have a centralised way to rename resource id and do not repeat this code, for example, in every controller. вторник, 9 октября 2012 г., 1:47:47 U

Re: [Rails-core] Test Locations in Rails 4

2012-10-08 Thread Mike Moore
FYI: https://github.com/rails/rails/pull/7878 -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscr

Re: [Rails-core] Customizable parameter name in routing.

2012-10-08 Thread Ryan Bigg
-1 on this also for reasons Piotr explained. On 09/10/2012, at 8:13, Nickolas wrote: > It does only half of the job. It changes the content of the parameter passed, > but not it's name. > The idea is to be able to change the name. > On Tuesday, October 9, 2012 12:03:54 AM UTC+4, Steve Klabni

Re: [Rails-core] Customizable parameter name in routing.

2012-10-08 Thread Nickolas
It does only half of the job. It changes the content of the parameter passed, but not it's name. The idea is to be able to change the name. On Tuesday, October 9, 2012 12:03:54 AM UTC+4, Steve Klabnik wrote: > Isn't this what to_param is for? > -- You received this message because you are subs

Re: [Rails-core] Customizable parameter name in routing.

2012-10-08 Thread Godfrey Chan
> it seems to me that Rails is all about aliasing LOL... this made my day :D Sent from my phone -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe fro

Re: [Rails-core] Customizable parameter name in routing.

2012-10-08 Thread Пуштаев Вадим
Hi.  I think that using resources:photos,:param_name=>'name' has some sense. First, it allows me to put all this logic in config/routes.rb where it belongs. Second, it allows me to get beautiful route map: GET /photos/:name instead of GET /photos/:id. Third, it seems to me that Rails is all about a

Re: [Rails-core] Customizable parameter name in routing.

2012-10-08 Thread Godfrey Chan
He is talking about the other side when the URL parameters get deserialized into the params hash. You can alias the param name in a before_filter in your controller (or application controller if you need this everywhere): before_filter :alias_id private def alias_id params[:slug] = parmas.de

Re: [Rails-core] Customizable parameter name in routing.

2012-10-08 Thread Steve Klabnik
Isn't this what to_param is for? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscr...@googlegro

Re: [Rails-core] Customizable parameter name in routing.

2012-10-08 Thread Piotr Sarnacki
On Mon, Oct 8, 2012 at 8:58 AM, Pascal Hurni wrote: > > There's nothing wrong with params[:id] containing "rails-tutorial", this > is a controller concern, the semantic is: "We have a request to find a > resource identified with params[:id]". Nowhere in Rails we say that this id > IS an ActiveReco

Re: [Rails-core] Customizable parameter name in routing.

2012-10-08 Thread Pascal Hurni
Hi Nickolas, Le 06.10.12 13:19, Nickolas a écrit : There is a function "resources" in the class "SingletonResource" that provides 7 routes for an indicated resource, like this: GET /photos GET /photos/:id etc. Also, there are some gems(as "friendly_id") that give a possibility to store an a

[Rails-core] Re: Option for inserts/updates/deletes on the Postgres adapter to return all columns, not just the id

2012-10-08 Thread Abdelkader Boudih
On Sunday, 7 October 2012 01:16:17 UTC+1, Robert wrote: > > By default with Rails, Postgres will return the id of a newly inserted > record using returning "id". Sometimes when working with Postgres, tables > will have triggers on them that modify the row's data while being saved. As > such, i

Re: [Rails-core] gitignore - adding database.yml

2012-10-08 Thread Craig Demyanovich
If you know on your projects that you always want to add config/database.yml to .gitignore as part of creating the application, then use an application template. It offers a file command

Re: [Rails-core] Option for inserts/updates/deletes on the Postgres adapter to return all columns, not just the id

2012-10-08 Thread Jack Christensen
On 10/6/2012 7:16 PM, Robert wrote: By default with Rails, Postgres will return the id of a newly inserted record using |returning "id"|. Sometimes when working with Postgres, tables will have triggers on them that modify the row's data while being saved. As such, it would be great to also pr