Skip to content

Instantly share code, notes, and snippets.

@daihuaye
Last active September 7, 2015 04:49
Show Gist options
  • Select an option

  • Save daihuaye/dd3881fc689f555f714a to your computer and use it in GitHub Desktop.

Select an option

Save daihuaye/dd3881fc689f555f714a to your computer and use it in GitHub Desktop.
# Auto loading file rules in Ruby on Rails
# the following class need to be under this file path: app/models/contract/document/uploader.rb
class Contract::Document::Uploader < CarrierWave::Uploader::Base
...
end
# This is an issue for us to relocate Mailer::Base(app/mailers/mailer) to app/mailers folder
# I have read online resource I can't find a way to break this.
# let me know if you find anything, if not, I think we should keep it under app/mailers/mailer for now
# If I need to make this work, I need to define a class without Module name, such as
# mailer_base.rb
class MailerBase
...
end
# asked.rb
class Asked < MailerBase
...
end
# contact_us.rb
class ContactUs < MailerBase
...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment