Class: StoriesController
Instance Method Summary
collapse
#next_wizard_path, #previous_wizard_path, #wizard_path
#current_step?, #future_step?, #jump_to, #last_step?, #next_step, #next_step?, #past_step?, #previous_step, #previous_step?, #skip_step, #step, #wizard_resource_class_name, #wizard_step_per_state, #wizard_steps
included
#current_ability
#voluntary_application_javascripts, #voluntary_application_stylesheets
included
Instance Method Details
#create ⇒ Object
28
29
30
31
32
33
34
|
# File 'app/controllers/stories_controller.rb', line 28
def create
if @story.initialization
redirect_to @story.after_creation_path and return
else
render_wizard
end
end
|
#destroy ⇒ Object
57
58
59
60
61
|
# File 'app/controllers/stories_controller.rb', line 57
def destroy
@story = Story.find(params[:id])
@story.destroy
redirect_to @story.project, notice: t('general.form.destroyed')
end
|
#edit ⇒ Object
36
37
38
39
40
|
# File 'app/controllers/stories_controller.rb', line 36
def edit
@twitter_sidenav_level = 5
render_wizard
end
|
#index ⇒ Object
14
15
16
17
|
# File 'app/controllers/stories_controller.rb', line 14
def index
parent = find_parent Story::PARENT_TYPES
@stories = parent ? parent.stories : Story.all
end
|
#new ⇒ Object
24
25
26
|
# File 'app/controllers/stories_controller.rb', line 24
def new
render_wizard
end
|
#parent ⇒ Object
71
72
73
|
# File 'app/controllers/stories_controller.rb', line 71
def parent
@project
end
|
#resource ⇒ Object
63
64
65
66
67
|
# File 'app/controllers/stories_controller.rb', line 63
def resource
@story = Story.find(params[:id]) unless @story || !params[:id].present?
@project = @story.project unless @project || !@story
@story
end
|
#resource=(value) ⇒ Object
69
|
# File 'app/controllers/stories_controller.rb', line 69
def resource=(value); @story = value; end
|
#show ⇒ Object
19
20
21
22
|
# File 'app/controllers/stories_controller.rb', line 19
def show
@comments = @story.
@twitter_sidenav_level = 5
end
|
#update ⇒ Object
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
# File 'app/controllers/stories_controller.rb', line 42
def update
@story.attributes = params[:story]
success = params[:next_step] == '1' ? @story.send(step) : @story.save
if success
redirect_to(
edit_story_path(@story), notice: t('general.form.successfully_updated')
)
else
render_wizard
end
return
end
|