Page Menu
Home
GRNET
Search
Configure Global Search
Log In
Files
F1299752
collection_responder.rb
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Nov 19, 12:41 AM
Size
941 B
Mime Type
text/x-ruby
Expires
Fri, Nov 21, 12:41 AM (1 d, 3 h)
Engine
blob
Format
Raw Data
Handle
292816
Attached To
rWEBDNS WebDNS (edet4)
collection_responder.rb
View Options
module
Responders
# This responder modifies your current responder to redirect
# to the collection page on POST/PUT/DELETE.
module
CollectionResponder
protected
# Returns the collection location for redirecting after POST/PUT/DELETE.
# This method, converts the following resources array to the following:
#
# [:admin, @post] #=> [:admin, :posts]
# [@user, @post] #=> [@user, :posts]
#
# When these new arrays are given to redirect_to, it will generate the
# proper URL pointing to the index action.
#
# [:admin, @post] #=> admin_posts_url
# [@user, @post] #=> user_posts_url(@user.to_param)
#
def
navigation_location
return
options
[
:location
]
if
options
[
:location
]
klass
=
resources
.
last
.
class
if
klass
.
respond_to?
(
:model_name
)
resources
[
0
...-
1
]
<<
klass
.
model_name
.
route_key
.
to_sym
else
resources
end
end
end
end
Event Timeline
Log In to Comment