Class FavoriteEnterprisesController
In: app/controllers/my_profile/favorite_enterprises_controller.rb
Parent: MyProfileController

Methods

add   index   remove  

Public Instance methods

[Source]

    # File app/controllers/my_profile/favorite_enterprises_controller.rb, line 11
11:   def add
12:     @favorite_enterprise = Enterprise.find(params[:id])
13:     if request.post? && params[:confirmation]
14:       profile.favorite_enterprises << @favorite_enterprise
15:       redirect_to :action => 'index' 
16:     end
17:   end

[Source]

   # File app/controllers/my_profile/favorite_enterprises_controller.rb, line 7
7:   def index
8:     @favorite_enterprises = profile.favorite_enterprises
9:   end

[Source]

    # File app/controllers/my_profile/favorite_enterprises_controller.rb, line 19
19:   def remove
20:     @favorite_enterprise = profile.favorite_enterprises.find(params[:id])
21:     if request.post? && params[:confirmation]
22:       profile.favorite_enterprises.delete(@favorite_enterprise)
23:       redirect_to :action => 'index'
24:     end
25:   end

[Validate]