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

Editing an agent returns you to correct scenario or index #1003

Merged
merged 3 commits into from Sep 11, 2015

Conversation

cantino
Copy link
Member

@cantino cantino commented Sep 1, 2015

Should fix #1002.

@knu, does this look good?

@cantino
Copy link
Member Author

cantino commented Sep 10, 2015

@knu, this refactor look okay?

@knu
Copy link
Member

knu commented Sep 10, 2015

@cantino Looks good!

@@ -14,7 +14,7 @@
<% @agents.each do |agent| %>
<tr>
<td class='<%= "agent-unavailable" if agent.unavailable? %>'>
<%= link_to agent.name, agent_path(agent) %>
<%= link_to agent.name, agent_path(agent, return: (defined?(return_to) && return_to) || request.path) %>
Copy link
Member

Choose a reason for hiding this comment

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

I just googled and read defined?() would work reliably for view locals in Rails 4.2, where you would have previously used local_assigns.has_key?. Nice to know!

cantino added a commit that referenced this pull request Sep 11, 2015
Editing an agent returns you to correct scenario or index
@cantino cantino merged commit 1a50eac into master Sep 11, 2015
@cantino cantino deleted the agent_editing_returns branch September 11, 2015 15:32
@cantino
Copy link
Member Author

cantino commented Sep 11, 2015

Thanks!

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.

Redirect back to scenario page
2 participants