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

update no_objects_found partial to allow not show new resource link #2289

Merged
merged 1 commit into from
May 3, 2018

Conversation

ccarruitero
Copy link
Contributor

Fix #2150

Like described in the issue mentioned above there is an error when we try to generate a new_object_url for stock movements, this because stock movements only allow index route.

Copy link
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

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

Thanks. That makes sense, but can be improved by using local_assigns.

@@ -1,4 +1,4 @@
<%= Spree.t(:no_resource, resource: plural_resource_name(resource)) %>
<% if can? :create, resource %>
<% if can? :create, resource and !new_resource_url.nil? %>
Copy link
Member

Choose a reason for hiding this comment

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

We should use local_assigns here to make it optional.

if can?(:create, resource) && local_assigns[:new_resource_url]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, is more clean like you propose 👍

I'll update the pulll request accordingly

@@ -41,7 +41,7 @@
<div class="col-9 no-objects-found">
<%= render 'spree/admin/shared/no_objects_found',
resource: Spree::StockMovement,
new_resource_url: new_object_url %>
new_resource_url: nil %>
Copy link
Member

Choose a reason for hiding this comment

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

We can remove this local entirely if we use local_assigns in the partial above.

Copy link
Contributor

@jhawthorn jhawthorn left a comment

Choose a reason for hiding this comment

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

Thank you

Copy link
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

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

Thanks

firmanm pushed a commit to firmanm/solidus that referenced this pull request Nov 27, 2017
update no_objects_found partial to allow not show new resource link
solidusio#2289
@tvdeyen tvdeyen merged commit 33d61e4 into solidusio:master May 3, 2018
@tvdeyen
Copy link
Member

tvdeyen commented May 3, 2018

Sorry that this took so long. Please feel free to ping us, if it takes too long for an approved PR to be merged.

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.

3 participants