bigdir/app/controllers/applied_project_controller.rb

17 lines
501 B
Ruby
Raw Normal View History

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