New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jw epic question update #750
Conversation
… study type question group
…note appears when editing a study
= form.object.selected_for_epic ? t(:constants)[:yes_select] : t(:constants)[:no_select] | ||
- if form.object.selected_for_epic | ||
= form.hidden_field :selected_for_epic, value: true | ||
- elsif !form.object.selected_for_epic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could else
work just as well here?
for k,v of answers | ||
array_values.push(v) | ||
nil_value = $.inArray('', array_values) > -1 | ||
if array_values[0] == 'true' || nil_value == false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd change nil_value == false
to !nil_value
data: answers | ||
url: "/study_type/determine_study_type_note" | ||
success: -> | ||
$('#study_type_note').show() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if this errors out? Should we do some error handling here on AJAX error?
@@ -90,6 +89,7 @@ def show | |||
end | |||
|
|||
def new | |||
@action = params['action'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can access the controller action using #action_name (http://stackoverflow.com/questions/15841617/if-action-name-rails)
.col-lg-4 | ||
= answer_form.select :answer, options_for_select([['Yes', true], ['No', false]], answer_form.object.answer), { include_blank: 'Select One' }, { class: 'selectpicker', id: "study_type_answer_#{answer_form.object.study_type_question.friendly_id}_answer" } | ||
- if USE_EPIC | ||
- if action == 'new' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- if action_name == 'new'
For more information, please refer to: https://www.pivotaltracker.com/story/show/133538113