Class LinksController
In: app/controllers/links_controller.rb
Parent: ApplicationController

Methods

create   destroy   edit  

Public Instance methods

REST-methods

[Source]

    # File app/controllers/links_controller.rb, line 23
23:   def create
24:     self.insert_links(@logi, @logi_version, params[:body_with_inserts])
25: 
26:     if @logi.errors.empty? and self.thorny_form_free_of_spam?
27:       flash[:notice] = t 'c.links.added'
28:       if !params[:and_attach] or params[:and_attach].empty?
29:         redirect_to logi_url(@logi)
30:       else
31:         @selected = 'link'
32:         @link_selected = 'tags_link'
33:         render :template => 'logi_inserts/new'
34:       end
35:     else
36:       flash[:error] = t 'c.links.error_adding'
37:       @selected = 'link'
38:       @link_selected = 'tags_link'
39:       render :template => 'logi_inserts/new'
40:     end
41:   end

[Source]

    # File app/controllers/links_controller.rb, line 47
47:   def destroy
48:     if params[:deleted_inserts] and !params[:deleted_inserts].empty?
49:       params[:deleted_inserts].each do |link_id|
50:         @logi.from_links.find(link_id).destroy
51:       end
52:       flash[:notice] = t 'c.links.removed'
53:       redirect_to logi_url(@logi.link)
54:     else
55:       flash[:warning] = t 'c.links.no_selected'
56:       self.edit
57:       render :template => 'links/edit'
58:     end
59:   end

[Source]

    # File app/controllers/links_controller.rb, line 43
43:   def edit
44:     @links = @logi.from_links
45:   end

[Validate]