Sha256: e9b77447cf3735dda28d046bbf601b241ee168b8686daa8b18ce42f6e7ccbbaf

Contents?: true

Size: 838 Bytes

Versions: 26

Compression:

Stored size: 838 Bytes

Contents

module NotifyUser
  class NotificationGenerator < Rails::Generators::NamedBase
    source_root File.expand_path('../templates', __FILE__)
    class_option :skip, default: true

    def generate_notification
      template "notification.rb.erb", "app/notifications/#{name.underscore}.rb"
      puts "If you wish this notification to be unsubscribable add it to the unsubscribable_notifications array in the initializer"

    end

    def generate_view_scaffolds
      template "email_template.html.erb.erb", "app/views/notify_user/#{name.underscore}/action_mailer/notification.html.erb"
      template "mobile_sdk_template.html.erb.erb", "app/views/notify_user/#{name.underscore}/mobile_sdk/notification.html.erb"
      template "email_layout_template.html.erb.erb", "app/views/notify_user/layouts/action_mailer.html.erb"
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
notify_user-0.1.4 lib/generators/notify_user/notification/notification_generator.rb
notify_user-0.1.3 lib/generators/notify_user/notification/notification_generator.rb
notify_user-0.1.2 lib/generators/notify_user/notification/notification_generator.rb
notify_user-0.1.1 lib/generators/notify_user/notification/notification_generator.rb
notify_user-0.0.30 lib/generators/notify_user/notification/notification_generator.rb
notify_user-0.0.29 lib/generators/notify_user/notification/notification_generator.rb
notify_user-0.0.28 lib/generators/notify_user/notification/notification_generator.rb
notify_user-0.0.27 lib/generators/notify_user/notification/notification_generator.rb
notify_user-0.0.26 lib/generators/notify_user/notification/notification_generator.rb
notify_user-0.0.25 lib/generators/notify_user/notification/notification_generator.rb
notify_user-0.0.24 lib/generators/notify_user/notification/notification_generator.rb
notify_user-0.0.23 lib/generators/notify_user/notification/notification_generator.rb
notify_user-0.0.22 lib/generators/notify_user/notification/notification_generator.rb
notify_user-0.0.20 lib/generators/notify_user/notification/notification_generator.rb
notify_user-0.0.19 lib/generators/notify_user/notification/notification_generator.rb
notify_user-0.0.18 lib/generators/notify_user/notification/notification_generator.rb
notify_user-0.0.16 lib/generators/notify_user/notification/notification_generator.rb
notify_user-0.0.15 lib/generators/notify_user/notification/notification_generator.rb
notify_user-0.0.14 lib/generators/notify_user/notification/notification_generator.rb
notify_user-0.0.12 lib/generators/notify_user/notification/notification_generator.rb