Class: Docent::LinksController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Docent::LinksController
- Defined in:
- app/controllers/docent/links_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'app/controllers/docent/links_controller.rb', line 18 def create @link = Link.new(params[:link]) if @link.save redirect_to links_url, notice: 'Successfully created link.' else render action: "new" end end |
#destroy ⇒ Object
38 39 40 41 42 43 |
# File 'app/controllers/docent/links_controller.rb', line 38 def destroy @link = Link.find(params[:id]) @link.destroy redirect_to links_url, notice: 'Successfully deleted link.' end |
#edit ⇒ Object
14 15 16 |
# File 'app/controllers/docent/links_controller.rb', line 14 def edit @link = Link.find(params[:id]) end |
#index ⇒ Object
6 7 8 |
# File 'app/controllers/docent/links_controller.rb', line 6 def index @links = Link.all end |
#new ⇒ Object
10 11 12 |
# File 'app/controllers/docent/links_controller.rb', line 10 def new @link = Link.new end |
#update ⇒ Object
28 29 30 31 32 33 34 35 36 |
# File 'app/controllers/docent/links_controller.rb', line 28 def update @link = Link.find(params[:id]) if @link.update_attributes(params[:link]) redirect_to links_url, notice: 'Successfully updated link.' else render action: "edit" end end |