Skip to content

Unable to view Plan Overview page for multi-phase templates #1548

@briri

Description

@briri

We removed the phase.questions shortcut in favor of using the full hierarchy chain phase.sections.[selector].questions.

App 539 output: ActionView::Template::Error (undefined method `questions' for #<Phase:0x00000000053313a0>
App 539 output: Did you mean?  sections):
App 539 output:     32:                   <div class="pull-left">
App 539 output:     33:                     <%= _("%{phase_title} (%{sections_size} %{sections}, %{questions_size} %{questions})") % {
App 539 output:     34:                       :phase_title => p.title, :sections_size => p.sections.size, :sections => n_('section', 'sections', p.sections.size),
App 539 output:     35:                       :questions_size => p.questions.size, :questions => n_('question', 'questions', p.questions.size) } %>
App 539 output:     36:                   </div>
App 539 output:     37:                   <div class="pull-right">
App 539 output:     38:                     <i class="fa fa-plus pull-right" aria-hidden="true"></i>
App 539 output:   app/views/plans/_overview_details.html.erb:35:in `block in _app_views_plans__overview_details_html_erb___4073258840737931792_42798460'
App 539 output:   app/views/plans/_overview_details.html.erb:22:in `_app_views_plans__overview_details_html_erb___4073258840737931792_42798460'
App 539 output:   app/views/plans/overview.html.erb:10:in `_app_views_plans_overview_html_erb__3921742541952334292_42858200'
App 539 output:   app/controllers/plans_controller.rb:372:in `overview'

Suggest instead to update the view logic to something like:p.sections.map{|s| s.questions.size }.inject(0){|sum,x| sum + x }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions