Flowdock
method

initializer

Importance_1
v3.2.8 - Show latest stable - 0 notes - Class: Rails::Generators::Actions
initializer(filename, data=nil, &block) public

Create a new initializer with the provided code (either in a block or a string).

Examples

initializer("globals.rb") do
  data = ""

  ['MY_WORK', 'ADMINS', 'BEST_COMPANY_EVAR'].each do |const|
    data << "#{const} = :entp\n"
  end

  data
end

initializer("api.rb", "API_KEY = '123456'")
Show source
Register or log in to add new notes.