17 lines
501 B
Ruby
17 lines
501 B
Ruby
|
class AppliedProjectController < ApplicationController
|
||
|
|
||
|
#申请加入项目
|
||
|
def applied_join_project
|
||
|
AppliedProject.create(:user_id => params[:user_id], :project_id => params[:project_id])
|
||
|
redirect_to_referer_or {render :text => ( 'applied success.'), :layout => true}
|
||
|
end
|
||
|
|
||
|
#取消申请
|
||
|
def unapplied_join_project
|
||
|
@applied = AppliedProject.find(params[:id])
|
||
|
@applied.destroy
|
||
|
redirect_to_referer_or {render :text => ( 'unsubscribe success.'), :layout => true}
|
||
|
end
|
||
|
|
||
|
end
|