Class: Ponytail::MigrationsController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- Ponytail::MigrationsController
- Defined in:
- app/controllers/ponytail/migrations_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'app/controllers/ponytail/migrations_controller.rb', line 14 def create @migration = Migration.new(migraion_params) if @migration.save redirect_to :migrations, notice: 'Migration was successfully created.' else render action: 'new' end end |
#index ⇒ Object
5 6 7 8 |
# File 'app/controllers/ponytail/migrations_controller.rb', line 5 def index @migrations = Migration.all @current_version = Migration.current_version end |
#migrate ⇒ Object
24 25 26 27 28 29 30 |
# File 'app/controllers/ponytail/migrations_controller.rb', line 24 def migrate if Migration.migrate redirect_to :migrations, notice: 'Migrate was succeed.' else redirect_to :migrations, notice: 'Migrate was failed.' end end |
#new ⇒ Object
10 11 12 |
# File 'app/controllers/ponytail/migrations_controller.rb', line 10 def new @migration = Migration.new end |