15 ms·
Rails 4.1.0 released
- recursive 13y agoI don't have much to say about any of the new functionality, but Spring seems like a very poor name for anything new related to programming.
- mountaineer 13y agoI agree with you, Spring is already well known in Java circles (and .NET to some extent).
- iagooar 13y agoAnd that's why it doesn't matter at all in the Ruby / Rails community ;)
- danielweber 13y agoAnd a nightmare for people in both the Java and Rails community when seeking jobs.
- r00fus 13y agoStill Google/search kind of flattens the namespace a bit. Now you're going to get lots and lots of Java Spring framework hits on any Ruby Spring google searches.
- midas007 13y agoSpring rails reloader gem. Solved.
- michh 13y agoExactly. Except they could have used Springloader or something as a shorthand for it (rather than Spring) and it wouldn't have been as much of an issue. It reminds me of when Wordpress gave one of their milestone releases the code-name Django. They actually changed it to "Rheinhardt" after the initial release because of the confusion it was causing. In this case it's even worse. Giving a component of a web framework the same name as a different, in a sense competing, framework is just plain silly.
- agotterer 13y agoAgreed. I'm a big Ruby fan, but some of the community naming choices are just annoying. In addition to spring: rack, sequel, devise, unicorn, faraday... I could keep going.
- callmeed 13y agoHaving mailer previews built in is pretty awesome. I pretty much use a gem for that on every project nowadays. The variants thing is interesting ... I'm assuming its an alternative to rendering a responsive/mobile-first view (on a view-by-view basis). I'm sure there are plenty of use-cases but I don't like the prospect of having to update yet-another-set-of-layouts-and-views.
- dhh 13y agoResponsive views only go so far. Trying to shrink an app designed for a desktop browser down to a 4" phone is a fool's errand. Much easier to go with different templates in that case.
- benwoodward 13y agoI guess you can mix responsive layouts with variant templates anyway, right? Just place your responsive markup in a partial and reference it in.
- oelmekki 13y ago> Trying to shrink an app designed for a desktop browser down to a 4" phone is a fool's errand That's why, when you design a responsive website, you're supposed to think / work out mobile first. Hoping to detect all mobile devices out there based on their http request is no wiser.
- sergiotapia 13y agoYou end up with a LOT of hidden or visible markup, redundant on both mobile and desktop. After working on responsive websites for about 2 years now, I feel that variants is the way to go with Mobile designs. You flesh out something lightweight for mobile and then another for tablet + desktop + whatever. Otherwise your mobile display is needlessly large.
- losvedir 13y agoMy company is still on Rails 3.2. We had been waiting for the first minor release of Rails 4 to give folks a chance to work out issues, so maybe now it's time to look at upgrading. Anyone have major issues going from 3.2 -> 4? I've heard horror stories about 2 -> 3, but I didn't pick up Rails myself until 3.x so I don't have firsthand experience. The biggest change I see is attr_accessible to strong_parameters. Does that mean I need to go through and rewrite all our models and controllers before we can update?
- dkokelley 13y agoI'm not 100% sure, but I believe you can upgrade without a lot of rewriting by using the protected_attributes gem (https://github.com/rails/protected_attributes https://github.com/rails/protected_attributes).
- kyleashipley 13y ago3.2 -> 4 is an order of magnitude easier than 2 -> 3. The upgrade guide is pretty solid, and I imagine it mostly applies for Rails 4.1 as well: http://guides.rubyonrails.org/upgrading_ruby_on_rails.html#upgrading-from-rails-3-2-to-rails-4-0 http://guides.rubyonrails.org/upgrading_ruby_on_rails.html#u... I spent most of my time updating app config. For several of my 3.2 apps, I started using strong_parameters, so it wasn't a leap for me. Another app I have on 4.0 is using the https://github.com/rails/protected_attributes https://github.com/rails/protected_attributes to retain the existing attr_accessible behavior until I get time to update. Hope that helps!
- mountaineer 13y agoI'm working on an update too, and am biting the bullet and rewriting the strong_parameters/attr_accessible parts. But, you can in theory use the Protected Attributes gem to aid migration with less rewrite.[1] [1] http://edgeguides.rubyonrails.org/upgrading_ruby_on_rails.html http://edgeguides.rubyonrails.org/upgrading_ruby_on_rails.ht...
- kule 13y agoIt's a way smoother upgrade - exactly as you mentioned really the only major change is from attr_accessible to strong parameters however you can still include the protected attributes gem for a quicker/easier upgrade path (https://github.com/rails/protected_attributes https://github.com/rails/protected_attributes)
- simple10 13y agoWe've been using Rails 4.1 release candidates for a couple of projects. It's worth the upgrade from 3.2. Here's a Rails 4.1.0 starter kit that's production ready and full featured: https://github.com/starterkits/rails4-starterkit https://github.com/starterkits/rails4-starterkit
- ch4s3 13y agoThis looks pretty nice, but do people actually use these for production apps? I'm not criticising, I'm legitimately curious .
- jrochkind1 13y agoI never heard of it before, and the url is timing out for me now (I was gonna say HN effect, but that's a github.com, uh oh. Anyway). I thought the Rails 'starter kit' was `rails new my_app_name`
- ch4s3 13y agoInteresting, I looked through it, and his other repos, and he seems to be a really solid rails guy. Looks like a promising kit, especially considering how much of a pita setting up CanCan with Rails 4 can be.
- simple10 13y agoThanks ch4s3. I released the starter kit after bashing my head in on a few configuration tasks with various gems. I haven't looked far and wide, but I think it's one of the more complete Rails 4 starter apps. I needed it for my own projects, but hopefully it can save some other devs configuration time. If you know of other solid starter app projects, I'm happy to fork them and make them discoverable in https://github.com/starterkits https://github.com/starterkits. It's meant to be a community project. I just haven't had any time to promote it.
- ch4s3 13y ago
- matthewmacleod 13y agoUpgrading from 4.0 to 4.1 1013 runs, 351 assertions, 6 failures, 832 errors, 0 skips Ouch. Still, it's great to see development on Rails continue. It really hits a great sweet spot for small to mid-sized apps. Edit: Actually easier than I thought; about 10 minutes to figure out the cause and remove a surplus gem, and we're all green. Cool.
- rubiquity 13y agoI think there's some pretty substantial ActiveRecord changes under the hood in Rails 4.1, so likely one of your gems are fighting with it and borking your test suite.
- gargarplex 13y agoWhat is great for large-sized apps?
- matthewmacleod 13y agoInteresting and complex question, that. Larger apps end up being more SOA than monolithic, I suppose. Rails can usually play a part in these, but in my experience it's usually a win to start fragmenting an app into services once it gets beyond a certain size and complexity.
- eggbrain 13y agoFor those curious as to how things go from Rails 3 to Rails 4.1, I've now built a few Rails 4 and 4.1 apps for clients and here's been my thoughts: 1) Turbolinks comes standard with Rails 4, and you will either love it or hate it. If you do use it, expect your javascript to break at one point or another. The jquery.turbolinks gem helps, but I've still had to debug a bunch of funky behavior with it. 2) Strong parameters takes a while to get used to from the old attr_accessesible way of doing things. That being said, I think it's worth it to learn it. It prevents a lot of conditional attr_accessible :blah, :as => :admin that goes on. The one thing I'd say is if you are going to use strong parameters, you might want to install a gem like Annotate so you can keep track of your attributes in the models. Sure you can just look in Schema.rb, but tabbing back and forth gets to be kind of a pain. 3) Secrets.yml is great, no more worrying about adding your config.secret_token to the .env file when generating every single project. 4) Mail Preview is nice, but for some reason I still seem to use Mailcatcher mostly to view / see how emails render out. Think this is mostly me sticking to my own ways. 5) ActionController::Live still feels pretty half baked. The fact that most examples / tutorials on the web still use the default example of: 100.times { response.stream.write "hello world\n" sleep 1 } Seems quite telling. It feels like they've given some of the pieces to get live streaming working flawlessly, but we are still missing a few tools here. ---- The biggest problem I've had is that some gems that we used frequently would break because they weren't Rails 4 ready. We use ActiveAdmin pretty frequently in our client apps, and it's worked for a while, but it's always been on a custom branch and still had some issues that were just recently fixed. YMMV for gems that your app relies on in terms of what will break and what will work.
- subsection1h 13y ago> Secrets.yml is great Yes, but I still prefer Figaro[1], which makes it super easy to configure an app on Heroku, especially when the app has multiple environments on Heroku: $ rake figaro:heroku[my-app-staging] $ rake figaro:heroku[my-app-production] [1] https://github.com/laserlemon/figaro https://github.com/laserlemon/figaro
- midas007 13y ago
- quaunaut 13y agoThe Enum implementation seems full of caveats. 1. It saves values as integers in the database, meaning that removing properties involves explicit setting, and reordering them requires custom migration code. 2. "Avoid using the same names inside different enums in the same class! Doing so will leave Active Record very confused!"[1] That's right, we can't use the same enum name to two different fields because ActiveRecord might get confused. That's kind of poor, isn't it? 3. Having to pass a macro that'll return the right integer instead of the symbol itself? Really? This all seems really unwieldy, especially in the face of Enumerize(https://github.com/brainspec/enumerize https://github.com/brainspec/enumerize). It's got none of these caveats. Is there some strength to the Rails enums that Enumerize doesn't capitalize on, other than size constraints by using Int instead of String? [1] http://brewhouse.io/blog/2013/12/17/whats-new-in-rails-4-1.html http://brewhouse.io/blog/2013/12/17/whats-new-in-rails-4-1.h...
- izietto 13y agoYes it's disappointing, above all considering that a better implementation is achievable in twenty lines of code in a model
- abvdasker 13y agoMailer previews will literally shave hours of time off of my email testing workflow — no more mail-to-a-test-account-and-wait garbage. And that's one of the minor features.
- thenduks 13y agoletter_opener[1] is really useful to avoid the test account + wait situation. Well, now you can just use mailer previews, I guess :) [1]: https://github.com/ryanb/letter_opener https://github.com/ryanb/letter_opener
- simple10 13y agopremailer is also useful. Even with the new Rails 4.1 email previews (available in development env), sometimes it's useful to be able to preview in production. https://github.com/fphilipe/premailer-rails https://github.com/fphilipe/premailer-rails
- matthewmacleod 13y agoAlso Mailcatcher, which runs a local SMTP server with a nice email-client-style web UI: http://mailcatcher.me http://mailcatcher.me
- rhizome 13y agoUnless you really need to be checking network deliver that much, mailers have long been testable, getting the last email sent from ActionMailer::Base.deliveries.last
- sergiotapia 13y agoBut you can just use 'letter_opener' and pow: Emails open up instantly on the browser to preview.
- easy_rider 13y agoHow will it 'preview' the sent mail? E-mail clients behave differently when it comes to layout. When I'm doing such testing, I still verify the mail in at least the top 90% tier e-mail clients (web and desktop).
- joevandyk 13y agoYou'd think the new enum support could use.. you know.. ENUMS. http://www.postgresql.org/docs/9.3/static/datatype-enum.html http://www.postgresql.org/docs/9.3/static/datatype-enum.html
- sergiotapia 13y agoI am _stupidly_ excited for Variants. No more .hidden-xs, visible-xs markup for me. I can taste the savings! :D A massive thank you to the Rails team for their time and commitment towards making the best web framework on the web even better!
- Podeau 13y agoMore info on Secrets.yml VS Figaro here http://collectiveidea.com/blog/archives/2013/12/18/the-marriage-of-figaro-and-rails/ http://collectiveidea.com/blog/archives/2013/12/18/the-marri...
- karmajunkie 13y agoAm I the only one who thinks the `Module.concerning` thing is silly? Concerns never did anything for reducing real complexity in the first place, except improve code geography, and now we don't even have to bother with that. Yay.
- DanielKehoe 13y agoI've updated the ‘Learn Ruby on Rails’ book for Rails 4.1: http://learn-rails.com/learn-ruby-on-rails.html http://learn-rails.com/learn-ruby-on-rails.html Also, there are 5 starter apps for Rails 4.1 from Rails Composer: http://blog.railsapps.org/post/79115273530/5-starter-apps-for-rails-4-1-from-rails-composer http://blog.railsapps.org/post/79115273530/5-starter-apps-fo...
- NicoJuicy 13y agoIs SQLLite fixed for Windows 7 or Windows 8 x64? This was the reason why i uninstalled Rails 4...
- desireco42 13y agoThe only thing I noticed, aside from secrets file and cookies etc that is outline in the notes, is that SimpleForm stopped working. Since project I was upgrading was small, I just removed it, but that is not option for bigger projects.