# File lib/js_routes.rb, line 147 def generate!(file_name = nil) # Some libraries like Devise do not yet loaded their routes so we will wait # until initialization process finish # https://github.com/railsware/js-routes/issues/7 Rails.configuration.after_initialize do file_name ||= self.class.configuration['file'] File.open(Rails.root.join(file_name), 'w') do |f| f.write generate end end end