File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -149,19 +149,17 @@ GEM
149149 rake (0.9.2 )
150150 rdoc (3.9.4 )
151151 responders (0.6.4 )
152- rspec (2.6.0 )
153- rspec-core (~> 2.6.0 )
154- rspec-expectations (~> 2.6.0 )
155- rspec-mocks (~> 2.6.0 )
156- rspec-core (2.6.4 )
157- rspec-expectations (2.6.0 )
158- diff-lcs (~> 1.1.2 )
159- rspec-mocks (2.6.0 )
160- rspec-rails (2.6.1 )
161- actionpack (~> 3.0 )
162- activesupport (~> 3.0 )
163- railties (~> 3.0 )
164- rspec (~> 2.6.0 )
152+ rspec (2.0.0.beta.19 )
153+ rspec-core (= 2.0.0.beta.19 )
154+ rspec-expectations (= 2.0.0.beta.19 )
155+ rspec-mocks (= 2.0.0.beta.19 )
156+ rspec-core (2.0.0.beta.19 )
157+ rspec-expectations (2.0.0.beta.19 )
158+ diff-lcs (>= 1.1.2 )
159+ rspec-mocks (2.0.0.beta.19 )
160+ rspec-rails (2.0.0.beta.19 )
161+ rspec (= 2.0.0.beta.19 )
162+ webrat (>= 0.7.2.beta.1 )
165163 rubyzip (0.9.4 )
166164 sass (3.1.7 )
167165 sass-rails (3.1.0.rc.6 )
197195 raindrops (~> 0.6 )
198196 warden (1.0.5 )
199197 rack (>= 1.0 )
198+ webrat (0.7.3 )
199+ nokogiri (>= 1.2.0 )
200+ rack (>= 1.0 )
201+ rack-test (>= 0.5.3 )
200202 xpath (0.1.4 )
201203 nokogiri (~> 1.3 )
202204
Original file line number Diff line number Diff line change 11// Place all the styles related to the Questions controller here.
22// They will automatically be included in application.css.
33// You can use Sass (SCSS) here: http://sass-lang.com/
4+ .flash {
5+ color : red ;
6+ padding : 2px ;
7+ font-size : 12 x;
8+ }
Original file line number Diff line number Diff line change 11class QuestionsController < InheritedController
2+
3+ def index
4+ @question = Question . new
5+ end
6+
7+ def create
8+ create! ( :notice => "Question Asked!" ) { collection_url }
9+ end
210end
Original file line number Diff line number Diff line change 88 = csrf_meta_tags
99 %body
1010 = render " shared/menu/user"
11- = yield
11+ .flash #{flash[:notice]}
12+ = yield
Original file line number Diff line number Diff line change 66 = f.input :description
77
88 .actions
9- = f.button :submit
9+ = f.button :submit , 'Ask Everyone'
Original file line number Diff line number Diff line change 1+ :javascript
2+ $ (document ).ready (function (){
3+ $ (' #ask_button' ).click (
4+ function (){
5+ $ (' #the_form' ).show ();
6+ $ (' #ask_button' ).remove ();
7+ });
8+ });
19- content_for :title do
210 Questions
311
1422 %th
1523 %th
1624
17- = render :partial => " list" , :collection => collection
25+ = render :partial => " list" , :collection => collection
26+ %div #the_form {:style=>'display:none'}
27+ = render " form"
28+ - if current_user
29+ %h3#ask_button Ask a question
Original file line number Diff line number Diff line change 11%h1 Home!
2+ %a (href ="/questions" ) Q&A
Original file line number Diff line number Diff line change 1+ require 'spec_helper'
2+
3+ describe "static/root" do
4+
5+ it "links to questions" do
6+ render
7+ rendered . should have_selector ( 'a' , :href => '/questions' )
8+ end
9+
10+ end
You can’t perform that action at this time.
0 commit comments