Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
  • Nov 19 2018 23:23
    kiddrew commented #14160
  • Nov 19 2018 23:23
    gmcgibbon synchronize #34468
  • Nov 19 2018 23:23
    kiddrew commented #14160
  • Nov 19 2018 23:12
    kamipo commented #34316
  • Nov 19 2018 23:10
    oniofchaos commented #34218
  • Nov 19 2018 23:09
    rafaelfranca synchronize #30320
  • Nov 19 2018 23:08
    oniofchaos commented #34236
  • Nov 19 2018 23:07
    rafaelfranca closed #34487
  • Nov 19 2018 23:07

    rafaelfranca on master

    Prevent TextHelper#word_wrap fr… Merge pull request #34488 from … (compare)

  • Nov 19 2018 23:07
    rafaelfranca closed #34488
  • Nov 19 2018 23:06
    rafaelfranca review_requested #34308
  • Nov 19 2018 23:05
    oniofchaos commented #34280
  • Nov 19 2018 23:01
    oniofchaos commented #34308
  • Nov 19 2018 22:52
    rafaelfranca synchronize #30320
  • Nov 19 2018 22:51

    rafaelfranca on master

    Indent guides as rails help com… Homogenize rails help output I… Merge pull request #34085 from … (compare)

  • Nov 19 2018 22:51
    rafaelfranca closed #34085
  • Nov 19 2018 22:51
    rafaelfranca commented #33643
  • Nov 19 2018 22:51
    rafaelfranca closed #33643
  • Nov 19 2018 22:50

    rafaelfranca on 5-2-stable

    Merge pull request #34106 from … (compare)

  • Nov 19 2018 22:49
    rafaelfranca synchronize #30320
Hello everyone, I'm buying backlinks for my site, is there a marketplace where I can connect with developers or webmasters willing to sell? Thank you
Hi everyone, Why my all routes point to the content of application.hmtl.erb file?
Mike Simkins
@Naren404 not sure I understand your comment. application.html is the base template for all your views. Your individual templates in your views for each controller just replace the <%= yield%> in that file
1 reply
So all the content in application.html effectively wraps around your other pages / or is included by them to put it another way
Sourav Goswami

I am working on a basic app called PhotoApp, where I am learning how to set up SMTP with rails. I have used basic Ruby with SMTP sometime ago, and I know my email works, just the emails sent gets to spam folder.

But when I am trying to configure SMTP on Rails, I am getting ArgumentError (SMTP-AUTH requested but missing user name):, and that's the primary reason why the app, when pushed to heroku, crashed every time a user signs up.

Error Image

Here's my config/environments/development.rb:

config.action_mailer.default_url_options = { host: 'localhost:8080' }
config.action_mailer.delivery_method = :smtp

config.action_mailer.smtp_settings = {
  address: 'smtp.gmail.com',
  port: 587,
  domain: 'example.net'
  authentication: 'plain',
  enable_starttls_auto: true,
  user_name: 'gmail_email',
  password: '...'

config.action_mailer.raise_delivery_errors = true
config.action_mailer.perform_deliveries = true

I am running the server on localhost:8080, in development mode, so my host is set to localhost:8080.

Apart from that I am not able to get my app working with my gmail username with SMTP in rails.

Edit, this ruby code works:

#!/usr/bin/ruby -w
require 'net/smtp'

message = <<~EOF
    From: mygmail@gmail.com
    To: someone@protonmail.com
    Subject: Hello!

        #{"HELLO ".*(50).delete_suffix(?\s)}

Net::SMTP.new('smtp.gmail.com', 587).tap(&:enable_starttls_auto).start('gmail.com', 'mygmail@gmail.com', 'mygmailpass', :plain) do |smtp|
    smtp.send_message message, 'mygmail@gmail.com', 'someone@protonmail.com'

But as a newbie to rails, I can't get actionmailer working when the same email is used in the config file...

I have asked the original question here
Sourav Goswami
Any idea guys?
@Souravgoswami Your domain is example.net... also it looks like your user_name is literally a string rather than an ENV variable. Did you mean ENV["gmail_email"] ? Also don't forget to set your ENV variables on your heroku instance (can do via the dashboard).
Sourav Goswami

Yes, that's a hardcoded string for test. I kept in mind not to push any changes to github or heroku. The hardcoded string was just for test. In rails, I could use the Rails credential or ENV.

But anyway, ENV['GMAIL_USERNAME'] will return username, and it will be a string, so putting hardcoded string should also work fine? Shouldn't it?

I tried another way, I tried creating an actionmailer controller, and guess what, actionmailer fails! It's actually not a devise problem. Not sure what's causing it...
Sourav Goswami

At this point it looks like a stupid bug somewhere in ActionMailer.

I also tried with RVM (same gem version). I haven't used ActionMailer previously, so I don't know if the previous versions worked or not. Do you guys had any problem with action mailer? Let me create an app from scratch on a different machine (although both have same OS, same Ruby, same everything else)

Sourav Goswami
It's rather weird. I think this is problem from my app itself. On my another system, I just ran whatever my code has, and it sent me the email... No issues with my config
Sourav Goswami

Oh man! The error is raised due to the use of sendgrid, sendgrid failed.

I completely forgot that the smtp_settings is overridden by environment.rb 🤦‍♂️

This is my stupid mistake
That much frustration when you copy paste some instruction because you are told to do so... :laughing:
hm, I just meant that "gmail_email" isn't an actual email address
is it working now?
Sourav Goswami
Yes it's working just fine!
I am getting following error when trying to deploy rails app using capistrano. Can someone help me to debug it.
01 $HOME/.rbenv/bin/rbenv exec bundle exec rake assets:precompile
01 rake aborted!
01 ActiveSupport::MessageEncryptor::InvalidMessage: ActiveSupport::MessageEncryptor::InvalidMessage
01 /home/deploy/mnryp/shared/bundle/ruby/2.7.0/gems/activesupport- _decrypt' 01 /home/deploy/mnryp/shared/bundle/ruby/2.7.0/gems/activesupport-…
01 /h
hm, dunno. looks like an ActiveSupport method message_encryptor is throwing an InvalidMessgae error on line 190 when you're precompiling assets
may be an env issue rails/rails#31397
ryantm Rails 6: I have a route like match "/catalog/:action", and this is a deprecation warning about dynamic :action routes. However, if I remove that route and addget "/catalog/product", to: 'catalog#product'and runurl_forwith no arguments, it fails withException: No route matches {:action=>"product", :controller=>"catalog"}` Is there some workaround for this?
ryantm * Rails 6: I have a route like match "/catalog/:action", and this is a deprecation warning about dynamic :action routes. However, if I remove that route and add get "/catalog/product", to: 'catalog#product'and runurl_forwith no arguments, it fails withException: No route matches {:action=>"product", :controller=>"catalog"} Is there some workaround for this?
ryantm Sorry, never mind, I figured out what I was doing wrong.
Jeff Dickey

Hey, folks; getting back into Rails for the first time in about 6 years and trying to have my way with ActionText/Trix in a form. I’m ripping my hair out (of a miniscule supply) trying to figure out how to set the editor content to an HTML string (either in a test or from a live form) the way I want to.

For example, I’m displaying the rich_text_area in the form using unescaped markup (I’ve tried raw in ERb and == in Slim; no difference), and markup that I enter manually using the editor UI is as I expect, but pasting any HTML in (either part of the content or the entire content) saves escaped HTML.

Any suggestions?

Andrew Stewart
Hey guys, has anyone run into No connection pool with 'primary' found. when trying to update an app from rails 4.2 to 5.2?
I've confirmed there's no issues with my database.yml
It just gives me this error no matter what I do
I can't run any rails command
cant even do a rails db:create, or rails db:migrate:reset
Andrew Stewart
Any thoughts?
Mohamed Taha
guys im using docker for development and heroku for production, the problem is the databases (prod & dev) are synchronised and i dunno why
Mohamed Taha
here is my database.yml file
Peder Tornberg
Hi guys. I'm thinking of using SSE for pushing out data to the view. However i'm a bit concerned that each request uses a single thread. Limiting to 16 requests per server. Is that true or have i missed something? is only solution to scale horizontally with more pods with only 16 threads/requests per pod?
James Ennis

Hi guys, wondered if someone could help me out with associations.

I have a reports table and a admin_users table. I'm adding a modified_by_admin_user_id column to the reports table. Now I want to be able to get the admin user who has modified the report from the report. So I'd expect something likeReport.first.modified_by_admin_user to return the admin user record.

Not quite sure how to set up the associations

Andrea Schiavini
Hi all, I'm having an issue with the ActiveRecord::ConnectionHandling thing in Rails6. I have an app where some models are fetched from different databases via connects_to. It was working well until I added a column to one of those databases, and the model is not seeing that column in its attributes
there is no schema.rb file for the other databases, so I don't know how to tell Rails: hey, this model has a new field, you should read it too
and I can't find any "schema cache" or anything similar
Mohamed Taha
hi guys
i have a problem with my associations where a i had many_to_many with multiple models
class User < ApplicationRecord has_many :purchases has_many :movies, through: :purchases has_many :seasons, through: :purchases end
class Movie < ApplicationRecord has_many :purchases has_many :users, through: :purchases end
class Season < ApplicationRecord
has_many :purchases
has_many :users, through: :purchases

class Purchase < ApplicationRecord
belongs_to :movie
belongs_to :season
belongs_to :user


the problem is when i want to create a purchase with movie_id and user_id it tells that the season must exist
pleasse help
Prince Joseph
@MohamedTaha123 Rails 5 and up changed belongs_to such that it is required by default. You can pass optional: true to belongs_to. See https://blog.bigbinary.com/2016/02/15/rails-5-makes-belong-to-association-required-by-default.html
I've been trying to get a Rails 6 API with Oauth, and.. this is anything but omakase! I'm completely lost, and there's little documentation on this. Devise + doorkeeper seems the best way to go about it. They have an example, but it's not commented at all.. I'm trying to reverse engineer it, but.. I don't suppose anyone happens to know a decent guide on how to do this?

Deciding between

  1. Rails API + React JS

  2. Rails 6 + Webpack

Does anyone have any articles they can share or pros/cons on using one or the other

I'm building a simple invoicing site and want to know what would be best for future buildout and possible React Native app