Class: RailsSpider::WorksController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- RailsSpider::WorksController
- Defined in:
- app/controllers/the_spider/works_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #parser ⇒ Object
- #run ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'app/controllers/the_spider/works_controller.rb', line 17 def create @work = Work.new(work_params) if @work.save redirect_to @work, notice: 'Work was successfully created.' else render :new end end |
#destroy ⇒ Object
46 47 48 49 |
# File 'app/controllers/the_spider/works_controller.rb', line 46 def destroy @work.destroy redirect_to works_url, notice: 'Work was successfully destroyed.' end |
#edit ⇒ Object
27 28 |
# File 'app/controllers/the_spider/works_controller.rb', line 27 def edit end |
#index ⇒ Object
6 7 8 |
# File 'app/controllers/the_spider/works_controller.rb', line 6 def index @works = Work.page(params[:page]) end |
#new ⇒ Object
13 14 15 |
# File 'app/controllers/the_spider/works_controller.rb', line 13 def new @work = Work.new end |
#parser ⇒ Object
42 43 44 |
# File 'app/controllers/the_spider/works_controller.rb', line 42 def parser ParserJob.perform_later(@work.id) end |
#run ⇒ Object
38 39 40 |
# File 'app/controllers/the_spider/works_controller.rb', line 38 def run WorkJob.perform_later(@work.id) end |
#show ⇒ Object
10 11 |
# File 'app/controllers/the_spider/works_controller.rb', line 10 def show end |
#update ⇒ Object
30 31 32 33 34 35 36 |
# File 'app/controllers/the_spider/works_controller.rb', line 30 def update if @work.update(work_params) redirect_to @work, notice: 'Work was successfully updated.' else render :edit end end |