Class: PivotalReporter::StoriesController
Instance Method Summary
collapse
#pivotal_project, #pivotal_unique_label
Instance Method Details
#accept ⇒ Object
29
30
31
32
33
34
|
# File 'app/controllers/pivotal_reporter/stories_controller.rb', line 29
def accept
@story = pivotal_project.stories.find(params[:id])
@story.update({current_state: 'accepted'})
redirect_to stories_path
end
|
#create ⇒ Object
17
18
19
20
21
22
23
24
25
26
27
|
# File 'app/controllers/pivotal_reporter/stories_controller.rb', line 17
def create
story = PivotalTracker::Story.new(params[:story]).create
if story.errors.count > 0
flash[:error] = "Report Submission Failed: #{story.errors}"
else
flash[:success] = 'Report Submitted!'
end
redirect_to new_story_path
end
|
#index ⇒ Object
5
6
7
|
# File 'app/controllers/pivotal_reporter/stories_controller.rb', line 5
def index
@stories = pivotal_project.stories.all(label: pivotal_unique_label)
end
|
#new ⇒ Object
13
14
15
|
# File 'app/controllers/pivotal_reporter/stories_controller.rb', line 13
def new
@pivotal_unique_label = pivotal_unique_label
end
|
#reject ⇒ Object
36
37
38
39
40
41
42
|
# File 'app/controllers/pivotal_reporter/stories_controller.rb', line 36
def reject
@story = pivotal_project.stories.find(params[:id])
@story.update({current_state: 'rejected'})
@story.notes.create(:text => URI.decode(params[:reject_message]))
redirect_to stories_path
end
|
#show ⇒ Object
9
10
11
|
# File 'app/controllers/pivotal_reporter/stories_controller.rb', line 9
def show
@story = pivotal_project.stories.find(params[:id])
end
|