Skip to content

Commit

Permalink
Don't let users try to submit a news if there is no section
Browse files Browse the repository at this point in the history
  • Loading branch information
nono committed May 12, 2011
1 parent 6da51b2 commit 3827e57
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
24 changes: 12 additions & 12 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ GEM
annotate (2.4.0)
arel (2.0.9)
autotest-standalone (4.5.5)
babosa (0.3.3)
babosa (0.3.4)
bcrypt-ruby (2.1.4)
bitfields (0.3.0)
builder (2.1.2)
Expand Down Expand Up @@ -99,8 +99,8 @@ GEM
jammit (0.6.0)
closure-compiler (>= 0.1.0)
yui-compressor (>= 0.9.1)
jquery-rails (1.0)
rails (~> 3.0)
jquery-rails (1.0.1)
railties (~> 3.0)
thor (~> 0.14)
kaminari (0.12.4)
rails (>= 3.0.0)
Expand Down Expand Up @@ -151,20 +151,20 @@ GEM
rake (0.8.7)
redcarpet (1.13.1)
redis (2.2.0)
rspec (2.5.0)
rspec-core (~> 2.5.0)
rspec-expectations (~> 2.5.0)
rspec-mocks (~> 2.5.0)
rspec-core (2.5.2)
rspec-expectations (2.5.0)
rspec (2.6.0)
rspec-core (~> 2.6.0)
rspec-expectations (~> 2.6.0)
rspec-mocks (~> 2.6.0)
rspec-core (2.6.0)
rspec-expectations (2.6.0)
diff-lcs (~> 1.1.2)
rspec-instafail (0.1.7)
rspec-mocks (2.5.0)
rspec-rails (2.5.0)
rspec-mocks (2.6.0)
rspec-rails (2.6.0)
actionpack (~> 3.0)
activesupport (~> 3.0)
railties (~> 3.0)
rspec (~> 2.5.0)
rspec (~> 2.6.0)
sanitize (2.0.1)
nokogiri (~> 1.4.4)
sass (3.1.1)
Expand Down
1 change: 1 addition & 0 deletions app/controllers/news_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def show
end

def new
redirect_to root_url, :alert => "Désolé, il n'est pas possible de proposer une dépêche en l'absence de sections" if Section.blank?
@news = News.new
end

Expand Down

0 comments on commit 3827e57

Please sign in to comment.