[Rails-core] Re: Argument against the slow removal of DSL features in Rails, like dynamic finders

2012-11-03 Thread Henrik N
On Friday, November 2, 2012 4:22:38 PM UTC+1, Jeff Cohen wrote: > > Rails 3 brought a slow death to another area of wonderful DSL-ness: > validations. Instead of this: > >validates_presence_of :title > > we're now supposed to use the generic form: > >validates :title, :presence => true >

[Rails-core] Idea: status code 404 AND debug info for RecordNotFound, RoutingError

2013-06-26 Thread Henrik N
The exceptions ActiveRecord::RecordNotFound and ActionController::RoutingError will give a 500 status in dev and test, but 404 in production. This means you can't easily write JS to rely on 404 responses from Ajax requests: it will work in production but not dev or test. It might be sensible to

[Rails-core] Re: Idea: status code 404 AND debug info for RecordNotFound, RoutingError

2013-06-26 Thread Henrik N
Actually, RoutingError seems to do this already. I noticed the lack in RecordNotFound, and incorrectly assumed RecordNotFound had the same problem. So RoutingError gets it right, but maybe RecordNotFound should do the same? On Wednesday, June 26, 2013 2:38:41 PM UTC+2, Henrik N wrote: > &g

[Rails-core] Re: unable to create ajax call in my rails app , any help ??

2013-06-26 Thread Henrik N
This list is the wrong forum, but try http://stackoverflow.com. Provide more details about your problem there. On Wednesday, June 26, 2013 11:34:14 AM UTC+2, hussainakhtar wahid wrote: > > hi all , > > I am unable to create ajax call in my rails app , any help ?? > -- You received this message

[Rails-core] Re: blacklists with strong parameters

2013-06-26 Thread Henrik N
If you really must, you could e.g. define a method on invoice along the lines of (untested) def self.permitted_params attribute_names - ["user_id"] end and then do permit(*Invoice.permitted_params) But like Brian said, whitelisting is more secure. On Saturday, June 1, 2013 11:43:04 PM UTC+2

[Rails-core] SimpleDelegator autoloading issue

2014-03-02 Thread Henrik N
I just blogged about an issue where SimpleDelegator in Rails breaks autoloading: http://thepugautomatic.com/2014/03/simpledelegator-autoloading-issues-with-rails/ Any thoughts about how (or if) Rails could solve this? -- You received this message because you are subscribed to the Google Groups

Re: [Rails-core] SimpleDelegator autoloading issue

2014-03-03 Thread Henrik N
On Monday, March 3, 2014 12:04:14 AM UTC+1, Henrik N wrote: > > On Sun, Mar 2, 2014 at 10:20 PM, Henrik Nyh wrote: > >> On Sun, Mar 2, 2014 at 8:11 PM, Xavier Noria wrote: >> >>> I believe the culprit here is Delegator. >>> Delegator owns const_missing

[Rails-core] Change default omission for truncate/excerpt to Unicode "…"

2016-12-02 Thread Henrik N
Hi, I'd love some feedback on whether it would be a good idea to change the default omission for the Rails "truncate" and "excerpt" helpers from three full stops ("...") to a Unicode ellipsis ("…"). I like how this only uses one character instead of three. Depending on the font, it can use up

[Rails-core] Re: Last call for patches - 2.3 final is imminent

2009-03-10 Thread Henrik N
Pratik wrote: > Hey all, > > As 2.3 RC2 is out, the plan is to have the 2.3 final release out as > early as possible. So we'd like to make the last call for patches. Minor regression, "auto_link should not linkify URLs in the middle of a tag": http://rails.lighthouseapp.com/projects/8994/ticket

[Rails-core] Make model.number = "1 234" store 1234 instead of 1?

2009-10-26 Thread Henrik N
Since our users have been complaining about putting "1 234" in a form and having 1 stored instead of 1234 (because of how to_i/to_f works), I made a simple monkeypatch to get their expected behavior: https://gist.github.com/3d99d172175ee3bc64a1 I'd be happy to submit a patch to Rails, but I want

[Rails-core] Re: Make model.number = "1 234" store 1234 instead of 1?

2009-10-26 Thread Henrik N
Thanks for the feedback, all. Can anyone think of a specific example of when the behavior I proposed would be undesirable? I can't think of anything. For most users, I imagine the suggested behavior follows the principle of least surprise and the current behavior does not. End users likely care

[Rails-core] Re: Make model.number = "1 234" store 1234 instead of 1?

2009-10-26 Thread Henrik N
On Oct 26, 2:43 pm, Xavier Noria wrote: > On Mon, Oct 26, 2009 at 1:48 PM, Henrik N wrote: > > On Oct 26, 1:09 pm, Xavier Noria wrote: > >> Don't see this in core. > > >> Looks like a custom numerification that makes sense in your > >> applicat

[Rails-core] Re: Make model.number = "1 234" store 1234 instead of 1?

2009-10-27 Thread Henrik N
On Oct 26, 5:06 pm, Xavier Noria wrote: > On Mon, Oct 26, 2009 at 4:38 PM, Henrik N wrote: > > I would like to see specific examples of why it might be a bad idea to > > remove the spaces. I'm hearing nays but I don't get what issues you > > see with this. I do

[Rails-core] Re: Make model.number = "1 234" store 1234 instead of 1?

2009-10-28 Thread Henrik N
On Oct 27, 6:59 pm, Xavier Noria wrote: > In particular > I don't see why given > >     12                             678 > > you one should pick 12678. I don't see why you don't pick 1000 out of > >     $1000 > > Wouldn't that be useful? What would a user could possibly mean other > than 1000?