- def make_public
- trace = Trace.find(params[:id])
-
- if @user and trace.user == @user
- if request.post? and !trace.public?
- trace.public = true
- trace.save
- flash[:notice] = t 'trace.make_public.made_public'
- redirect_to :controller => 'trace', :action => 'view', :id => params[:id]
- else
- render :nothing => true, :status => :bad_request
- end
- else
- render :nothing => true, :status => :forbidden
- end
- rescue ActiveRecord::RecordNotFound
- render :nothing => true, :status => :not_found
- end
-