Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Get the id of the current page
- def current_page_id
- url = request.fullpath
- action = ActionController::Routing::Routes.recognize_path(url)
- id = false
- Page.all.each do |page|
- if page.slug["name"] == action
- id = page.id
- end
- end
- return id
- end
Add Comment
Please, Sign In to add comment