Class: Ponytail::MigrationsController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
app/controllers/ponytail/migrations_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



17
18
19
20
21
# File 'app/controllers/ponytail/migrations_controller.rb', line 17

def create
  @migration = Migration.create(migraion_params)
  flash[:notice] = "Migration was successfully created."
  respond_with @migration
end

#destroyObject



23
24
25
26
27
28
29
30
31
32
# File 'app/controllers/ponytail/migrations_controller.rb', line 23

def destroy
  @migration = Migration.find(params[:id].to_i)
  if @migration
    @migration.destroy
    flash[:notice] = "Migration was successfully deleted."
    respond_with @migration
  else
    render nothing: true, status: 404
  end
end

#indexObject



7
8
9
10
# File 'app/controllers/ponytail/migrations_controller.rb', line 7

def index
  @migrations = Migration.all
  respond_with @migrations
end

#newObject



12
13
14
15
# File 'app/controllers/ponytail/migrations_controller.rb', line 12

def new
  @migration = Migration.new
  @schema = Schema.new
end