Last active
August 29, 2015 14:24
-
-
Save gramos/d49697364aecf2017cc7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Error: | |
line: prototype.call(env) | |
file: /home/gramos/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/cuba-3.4.0/lib/cuba.rb +74 | |
line: dup.call!(env) | |
file: /home/gramos/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/cuba-3.4.0/lib/cuba.rb +111 | |
line: catch(:halt) do | |
file: /home/gramos/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/cuba-3.4.0/lib/cuba.rb +126 | |
line: catch(:halt) do | |
file: /home/gramos/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/cuba-3.4.0/lib/cuba.rb +126 | |
line: instance_eval(&@blk) | |
file: /home/gramos/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/cuba-3.4.0/lib/cuba.rb +127 | |
line: instance_eval(&@blk) | |
file: /home/gramos/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/cuba-3.4.0/lib/cuba.rb +127 | |
line: on 'instructor' do | |
file: /home/gramos/trabajos/altoros/skillvana/skillvana.com/routes/instructor/courses.rb +8 | |
line: try do | |
file: /home/gramos/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/cuba-3.4.0/lib/cuba.rb +161 | |
line: yield | |
file: /home/gramos/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/cuba-3.4.0/lib/cuba.rb +200 | |
line: yield(*captures) | |
file: /home/gramos/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/cuba-3.4.0/lib/cuba.rb +180 | |
line: on 'courses/:id/branding' do |id| | |
file: /home/gramos/trabajos/altoros/skillvana/skillvana.com/routes/instructor/courses.rb +64 | |
line: try do | |
file: /home/gramos/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/cuba-3.4.0/lib/cuba.rb +161 | |
line: yield | |
file: /home/gramos/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/cuba-3.4.0/lib/cuba.rb +200 | |
line: yield(*captures) | |
file: /home/gramos/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/cuba-3.4.0/lib/cuba.rb +180 | |
line: render('instructor/courses/branding', course: Course[id], | |
file: /home/gramos/trabajos/altoros/skillvana/skillvana.com/routes/instructor/courses.rb +65 | |
line: res.write(view(template, locals, layout)) | |
file: /home/gramos/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/mote-render-1.1.0/lib/mote/render.rb +11 | |
line: return partial(layout, locals.merge(content: partial(template, locals))) | |
file: /home/gramos/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/mote-render-1.1.0/lib/mote/render.rb +15 | |
line: return mote(mote_path(template), locals.merge(app: self), TOPLEVEL_BINDING) | |
file: /home/gramos/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/mote-render-1.1.0/lib/mote/render.rb +19 | |
line: mote_cache[file][params] | |
file: /home/gramos/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/mote-1.1.4/lib/mote.rb +55 | |
line: mote_cache[file][params] | |
file: /home/gramos/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/mote-1.1.4/lib/mote.rb +55 | |
line: (Can't display line) | |
file: (eval) +19 | |
NameError: undefined local variable or method `course' for #<Binding:0x007fefdf08a580> | |
# test/integration/instructor/dashboard_test.rb | |
test 'from the dashboard I can create a new course' do | |
visit '/' | |
click_link 'Add a new course' | |
fill_in 'course[name]', with: 'Guitar first steps' | |
fill_in 'course[short_description]', with: 'Learn to play the 6 strings' | |
fill_in 'course[description]', with: 'Learn to play the 6 strings' | |
fill_in 'course[support_email]', with: 'instructor@skillvana.com' | |
click_button 'Continue' | |
assert has_content? 'Course branding' | |
end | |
# views/layout.mote | |
<div id="menu"> | |
<div class="pure-menu pure-menu-open"> | |
% if menu.include? "edit_menu" | |
{{ app.partial menu, course: course }} | |
% else | |
{{ app.partial menu }} | |
% end | |
<br /> | |
<ul class="pure-menu-list"> | |
% if app.authenticated(User) | |
<li><a href="/logout">Logout</a></li> | |
% end | |
</ul> | |
</div> | |
</div> | |
# views/instructor/courses/edit_menu.mote | |
<ul> | |
<li><a href="/instructor">Dashboard</a></li> | |
</ul> | |
<ul> | |
<li><a href="/instructor/courses/{{course.id}}/edit">Details</a></li> | |
<li><a href="/instructor/courses/{{course.id}}/branding">Branding</a></li> | |
<li><a href="/instructor/courses/{{course.id}}/lessons">Lessons</a></li> | |
<li><a href="/instructor">Update/News</a></li> | |
<li><a href="/instructor">Assintans</a></li> | |
<li><a href="/instructor">Integrations</a></li> | |
</ul> | |
# routest/instructor/courses.rb | |
Module Instructor | |
class Courses < Cuba | |
define do | |
on root do | |
res.redirect 'instructor' | |
end | |
on 'instructor' do | |
on 'courses/new' do | |
render('instructor/courses/new', menu: "instructor/dashboard_menu") | |
end | |
on 'courses/:id/branding' do |id| | |
render('instructor/courses/branding', course: Course[id], | |
menu: 'instructor/courses/edit_menu') | |
end | |
on 'courses' do | |
on post do | |
on param("course") do |course| | |
c = Course.create course | |
authenticated(User).courses.add c | |
res.redirect "/instructor/courses/#{c.id}/branding" | |
end | |
end | |
end | |
end | |
end | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment