# File app/controllers/milestones_controller.rb, line 42 def create @milestone = @project.milestones.new(params[:milestone]) if @milestone.save redirect_to project_milestone_path(@project, @milestone) else render "new" end end
# File app/controllers/milestones_controller.rb, line 67 def destroy return access_denied! unless can?(current_user, :admin_milestone, @milestone) @milestone.destroy respond_to do |format| format.html { redirect_to project_milestones_path } format.js { render nothing: true } end end
# File app/controllers/milestones_controller.rb, line 28 def edit respond_with(@milestone) end
# File app/controllers/milestones_controller.rb, line 13 def index @milestones = case params[:f] when 'all'; @project.milestones else @project.milestones.active end @milestones = @milestones.includes(:project).order("due_date") @milestones = @milestones.page(params[:page]).per(20) end
# File app/controllers/milestones_controller.rb, line 23 def new @milestone = @project.milestones.new respond_with(@milestone) end
# File app/controllers/milestones_controller.rb, line 32 def show @issues = @milestone.issues @users = @milestone.participants respond_to do |format| format.html format.js end end
# File app/controllers/milestones_controller.rb, line 52 def update @milestone.update_attributes(params[:milestone]) respond_to do |format| format.js format.html do if @milestone.valid? redirect_to [@project, @milestone] else render :edit end end end end
# File app/controllers/milestones_controller.rb, line 80 def milestone @milestone ||= @project.milestones.find(params[:id]) end
# File app/controllers/milestones_controller.rb, line 88 def module_enabled return render_404 unless @project.issues_enabled end