3 ms·
Can you give real examples? I've always heard this complaint about Rails but have also built a few large apps in it and never felt these problems myself.
by dchuk 9y ago
Can you give real examples? I've always heard this complaint about Rails but have also built a few large apps in it and never felt these problems myself.
- nimblegorilla 9y agoI think a lot of the problem comes from Rails ease of setup. You can get Devise working in about 10-20 minutes. Then you want to customize something and it takes an afternoon to figure out. With any other framework that's par for the course. Yet somehow developers expect rails to spoon-feed them the entire way.
- vertex-four 9y agoA couple of specific issues include that email to multiple users is difficult to get right - googling for it results in a number of weird hacks, with Rails providing nothing itself, and the most obvious mechanism involving a lot of logic in your controllers - and Devise's invitations stuff is very inflexible, making a number of assumptions about what data should be stored (invitation timestamps being the major one). Given that a goal of this specific app is to store as little data as possible, that's unacceptable, and resulted in a fair bit of monkeypatching. And that seems to be the core of it - monkeypatching things or depending on implementation details seems to be the norm when trying to get Rails and its supporting ecosystem to do something other than what it does by default, and that's difficult to maintain over the long term. And if you can't depend on Rails and co being flexible enough to do what you want, you might as well build on a less-opinionated framework from the start and skip the step of trying to bend Rails into shape.
- meesterdude 9y ago> if you can't depend on Rails and co being flexible enough to do what you want, you might as well build on a less-opinionated framework from the start and skip the step of trying to bend Rails into shape. Sending email is one of the things rails does out of the box. ActionMailer is builtin. I myself use mailgun as the provider - it took me 5 minutes going. But there are plenty of ways to do it for what your needs are. Rails has an opinion on how to do things, but you can do your own thing too. Those opinions it comes with let you ship better code faster, and allow you to focus on the real problems of your project. But rails, in my 8 years of working every day with it across a multitude of projects, has never been not flexible enough.
- vertex-four 9y ago> Sending email is one of the things rails does out of the box. ActionMailer is builtin. Yep. ActionMailer is great at sending email... to one person. Where the logic goes in Rails for sending email to multiple people, nobody has a good answer.
- dchuk 9y agoHave you read the official docs? http://guides.rubyonrails.org/action_mailer_basics.html http://guides.rubyonrails.org/action_mailer_basics.html 2.3.3 Sending Email To Multiple Recipients It is possible to send email to one or more recipients in one email (e.g., informing all admins of a new signup) by setting the list of emails to the :to key. The list of emails can be an array of email addresses or a single string with the addresses separated by commas. class AdminMailer < ApplicationMailer default to: Proc.new { Admin.pluck(:email) }, from: 'notification@example.com' def new_registration(user) @user = user mail(subject: "New User Signup: #{@user.email}") end end The same format can be used to set carbon copy (Cc:) and blind carbon copy (Bcc:) recipients, by using the :cc and :bcc keys respectively. As for Devise, it's not a part of Rails, and there are a few alternative auth gems you can use, so it's not really a valid criticism of the framework if the thing you don't like isn't in the actual framework.