Skip to content
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

Merged
merged 31 commits into from Nov 22, 2016
Merged

Jw epic question update #750

merged 31 commits into from Nov 22, 2016

Conversation

jwiel86
Copy link
Contributor

@jwiel86 jwiel86 commented Nov 21, 2016

For more information, please refer to: https://www.pivotaltracker.com/story/show/133538113

= 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
Copy link
Contributor

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
Copy link
Contributor

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()
Copy link
Contributor

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']
Copy link
Contributor

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'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • if action_name == 'new'

@jleonardw9 jleonardw9 merged commit 6a5f165 into master Nov 22, 2016
@jleonardw9 jleonardw9 deleted the jw_epic_question_update branch November 22, 2016 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants