-
Notifications
You must be signed in to change notification settings - Fork 4
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
Adds URLs to ETD show page, and degree awarded notification. #963
Conversation
app/views/hyrax/base/show.html.erb
Outdated
@@ -5,7 +5,9 @@ | |||
<%= render 'work_title', presenter: @presenter %> | |||
</header> | |||
|
|||
<span>Permanent URL: <%= Rails.application.routes.url_helpers.send(@presenter.model_name.singular_route_key + '_url', @presenter.id) %></span> |
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.
Why do we need to do #send
here? Don't we have access to the url_helpers
natively in the view?
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.
That was the idiom I saw in the code base (https://github.com/curationexperts/laevigata/blob/master/app/services/hyrax/workflow/laevigata_notification.rb#L21). Rails.application.routes.url_helpers.hyrax_etd_url(@presenter)
also works, but hyrax_etd_url(@presenter)
, and url_for(@presenter)
do not.
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.
Is the right thing main_app.etd_url(...)
?
If not, we should probably at least do public_send
instead of send
. :)
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.
👍
No tests, as these are in views, although I'm happy to add them.
Here's a before:
And after: