from Hacker News

Ruby on Rails 5.1

by alifbae on 5/12/17, 2:04 PM with 32 comments

  • by eagsalazar2 on 5/12/17, 5:10 PM

    Yarn and Webpack integration is already changing my life (for the better). Documentation on both still sucks however. In particular the inclusion of yarn and webpack represent a significant change in development workflows that they've not really outlined yet.
  • by 3pt14159 on 5/12/17, 5:13 PM

    I'm still surprised they removed the formatting for db/schema.rb which I rely on quite a bit to remind myself what properties models have, whether or not their status can be set to null, and how many digits of precision my decimal columns have.

    I went as far as writing my own formatter which consumes the db/schema.rb generated string and outputs another string with better formatting. The code is kinda shaky because I wrote it in a rush, but if anyone is interested I can share it with them.

  • by brandoncordell on 5/12/17, 7:08 PM

    The new form_with is bugging me. It doesn't generate id's on inputs anymore, so you have to manually add `id: 'field_id'` so that clicking labels focuses on the input. Not having the id attribute has also broken Capybara's `fill_in 'Label text'` for me.
  • by shawabawa3 on 5/12/17, 4:18 PM

    jQuery no longer being a default dependency is great! been waiting for that for a while
  • by MichaelBurge on 5/12/17, 4:46 PM

    It looks like "System Test" is what they call end-to-end testing using tools like Selenium with a browser. Scripts that e.g. send POST requests to the server process and check the result seem to also be included.

    The new form_with looks convenient. It was always annoying occasionally having to switch all the methods out when a form gets more complex.

    I don't really use frontend Javascript stuff, but mostly because it was a pain getting it to work with Rails and doesn't provide much benefit. Maybe in another year the Webpack changes will have made it worth using.

  • by nathan_f77 on 5/12/17, 6:41 PM

    Wow, the yarn and webpack support is awesome! I've been using the react_on_rails gem, and I didn't like how the webpack stuff felt "tacked on", and I had to run a whole bunch of different stuff using guard. Hopefully they can work with these changes and let me get back to a single "rails server" command.

    "System tests" look great, too. It's great that they've brought this in as a convention, since every Rails project I've worked on has configured capybara for integration tests.

  • by pqdbr on 5/12/17, 4:42 PM

    I love Rails :)
  • by swrobel on 5/12/17, 4:38 PM

    This was released on April 27. Old news.