Skip to content

Instantly share code, notes, and snippets.

@gramos
Created July 10, 2015 19:07
Show Gist options
  • Save gramos/7817677987c53fa5b0e4 to your computer and use it in GitHub Desktop.
Save gramos/7817677987c53fa5b0e4 to your computer and use it in GitHub Desktop.
# routes/instructor/courses.rb
module Instructor
class Courses < Cuba
define do
on 'courses/:permalink/edit' do |permalink|
on get do
course = Course.find_by_permalink( permalink )
render('instructor/courses/edit', course: course,
menu: "instructor/courses/edit_menu")
end
end
end
end
# ---------------------------------------------------------------
# views/layout
....
{{app.partial menu}}
....
# ----------------------------------------------------------------
# views/instructor/courses/edit_menu.mote
<ul>
<li><a href="/instructor/courses/{{course.to_param}}/edit">Details</a></li>
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment