Re: Feature: Simple controllers?
2011/9/24 Bartosz Dziewoński matma@gmail.com: So, are we reverting it? It's still in the latest GitHub commit. I've reverted it. ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: Feature: Simple controllers?
So, are we reverting it? It's still in the latest GitHub commit. (If it was unclear, I agree with Jenna - while certainly neat, this should go.) -- Matma Rex ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Feature: Simple controllers?
I just pushed a new feature to Camping: Simple controllers. module App::Controllers get '/(.*)' do |name| Hello #{name} end end What do you think? Useful? Or should I revert it? It currently costs us 87 bytes. // Magnus Holm ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: Feature: Simple controllers?
Personally I probably won't be using it, I like having class names around and being able to link to them with R(). (I change my paths often.) Certainly won't hurt to have it, for really small apps. -- Matma Rex ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: Feature: Simple controllers?
If I wanted that notation, I'd just use Sinatra. ;) Like Bartosz, I like having named controllers so that I can pass them to R() when generating links. On Thu, Aug 25, 2011 at 10:20 AM, Magnus Holm judo...@gmail.com wrote: I just pushed a new feature to Camping: Simple controllers. module App::Controllers get '/(.*)' do |name| Hello #{name} end end What do you think? Useful? Or should I revert it? It currently costs us 87 bytes. // Magnus Holm ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: Feature: Simple controllers?
On Thu, Aug 25, 2011 at 21:28, David Susco dsu...@gmail.com wrote: Would you have to write the RE for every declaration? ie... module App::Controllers get '/(.*)' do |name| Hello #{name} end put '/(.*)' do |name| Hello #{name} end end That wouldn't work. Camping would dispatch all methods to the first controller (so you'll get a 501 error when you PUT). In that case you'll have to refactor it into a proper controller. Which I consider a good thing (DRY etc.) ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: Feature: Simple controllers?
I vote revert. This is just sinatra - I feel it's important camping maintains the cleanliness and clarity of functionality given to us by using simple classes. It's something we have which AFAIK no other ruby web framework does - you know exactly how it works, because it's just a class. On 26/08/2011, at 7:21 AM, Magnus Holm wrote: On Aug 25, 2011 10:54 PM, John Beppu john.be...@gmail.com wrote: If I wanted that notation, I'd just use Sinatra. ;) Like Bartosz, I like having named controllers so that I can pass them to R() when generating links. Does it make it better that you can name them too? Index = get / do ... end Sent from my iCampingPhone ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: Feature: Simple controllers?
Being able to name controllers definitely makes it more valuable. If I had to criticize Sinatra and its clones, I would criticize their lack of named controllers. It's difficult to write URL generation functions without them. I've only seen one Sinatra clone (Slim in php) that allows controllers to be named. On Thu, Aug 25, 2011 at 2:21 PM, Magnus Holm judo...@gmail.com wrote: On Aug 25, 2011 10:54 PM, John Beppu john.be...@gmail.com wrote: If I wanted that notation, I'd just use Sinatra. ;) Like Bartosz, I like having named controllers so that I can pass them to R() when generating links. Does it make it better that you can name them too? Index = get / do ... end Sent from my iCampingPhone ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list