Class: Lit::SourcesController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Lit::SourcesController
- Defined in:
- app/controllers/lit/sources_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #synchronize ⇒ Object
- #touch ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
33 34 35 36 37 38 39 40 |
# File 'app/controllers/lit/sources_controller.rb', line 33 def create @source = Source.new(clear_params) if @source.save redirect_to @source, :notice => 'Source was successfully created.' else render :action => "new" end end |
#destroy ⇒ Object
51 52 53 54 55 |
# File 'app/controllers/lit/sources_controller.rb', line 51 def destroy @source = Source.find(params[:id]) @source.destroy redirect_to sources_url end |
#edit ⇒ Object
17 18 19 |
# File 'app/controllers/lit/sources_controller.rb', line 17 def edit @source = Source.find(params[:id]) end |
#index ⇒ Object
5 6 7 |
# File 'app/controllers/lit/sources_controller.rb', line 5 def index @sources = Source.all end |
#new ⇒ Object
13 14 15 |
# File 'app/controllers/lit/sources_controller.rb', line 13 def new @source = Source.new end |
#show ⇒ Object
9 10 11 |
# File 'app/controllers/lit/sources_controller.rb', line 9 def show @source = Source.find(params[:id]) end |
#synchronize ⇒ Object
21 22 23 24 25 |
# File 'app/controllers/lit/sources_controller.rb', line 21 def synchronize @source = Source.find(params[:id]) @source.synchronize redirect_to lit.source_incomming_localizations_path(@source) end |
#touch ⇒ Object
27 28 29 30 31 |
# File 'app/controllers/lit/sources_controller.rb', line 27 def touch @source = Source.find(params[:id]) @source.touch_last_updated_at! redirect_to request.env["HTTP_REFERER"].present? ? :back : @source end |
#update ⇒ Object
42 43 44 45 46 47 48 49 |
# File 'app/controllers/lit/sources_controller.rb', line 42 def update @source = Source.find(params[:id]) if @source.update_attributes(clear_params) redirect_to @source, :notice => 'Source was successfully updated.' else render :action => "edit" end end |