diff --git a/.gitignore b/.gitignore index 4fb0863..59d64ee 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ spec/dummy/.sass-cache spec/dummy/public *.gem routes.txt +/.project diff --git a/Gemfile b/Gemfile index c71fd3b..ea5eaaa 100644 --- a/Gemfile +++ b/Gemfile @@ -27,7 +27,6 @@ gem 'devise_simply_stored', github: 'bterkuile/devise_simply_stored' gem 'slim-rails' gem 'paperclip', ['>= 3.4', '!= 4.3.0'] gem 'email_validator' -gem 'actionpack-page_caching' # Declare any dependencies that are still in development here instead of in # your gemspec. These might include edge Rails or gems from your path or # Git. Remember to move these dependencies to your gemspec before releasing @@ -38,6 +37,7 @@ group :development, :test do gem 'rspec-rails' gem 'pry-rails' end + group :test do gem 'factory_girl_rails' gem 'capybara' @@ -45,6 +45,7 @@ group :test do gem 'rspec-its' gem 'launchy' end + group :development do gem 'thin' #gem 'ruby-debug19', :require => 'ruby-debug' diff --git a/Gemfile.lock b/Gemfile.lock index b2a5594..1e6158c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -13,11 +13,11 @@ GIT GIT remote: git://github.com/bterkuile/simply_stored.git - revision: 05cb3a06a9d4a3588efd4491db42fac84276befb + revision: 0941952120c7fbb3c7a38486cd26d9380fb657aa specs: simply_stored (1.0.0) activesupport - couch_potato (>= 0.2.15) + couch_potato (>= 1.4.0) rest-client (>= 1.4.2) PATH @@ -38,52 +38,50 @@ PATH GEM remote: http://rubygems.org/ specs: - ace-rails-ap (3.0.3) - actionmailer (4.2.3) - actionpack (= 4.2.3) - actionview (= 4.2.3) - activejob (= 4.2.3) + ace-rails-ap (4.0.0) + actionmailer (4.2.4) + actionpack (= 4.2.4) + actionview (= 4.2.4) + activejob (= 4.2.4) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 1.0, >= 1.0.5) - actionpack (4.2.3) - actionview (= 4.2.3) - activesupport (= 4.2.3) + actionpack (4.2.4) + actionview (= 4.2.4) + activesupport (= 4.2.4) rack (~> 1.6) rack-test (~> 0.6.2) rails-dom-testing (~> 1.0, >= 1.0.5) rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionpack-page_caching (1.0.2) - actionpack (>= 4.0.0, < 5) - actionview (4.2.3) - activesupport (= 4.2.3) + actionview (4.2.4) + activesupport (= 4.2.4) builder (~> 3.1) erubis (~> 2.7.0) rails-dom-testing (~> 1.0, >= 1.0.5) rails-html-sanitizer (~> 1.0, >= 1.0.2) - activejob (4.2.3) - activesupport (= 4.2.3) + activejob (4.2.4) + activesupport (= 4.2.4) globalid (>= 0.3.0) - activemodel (4.2.3) - activesupport (= 4.2.3) + activemodel (4.2.4) + activesupport (= 4.2.4) builder (~> 3.1) - activerecord (4.2.3) - activemodel (= 4.2.3) - activesupport (= 4.2.3) + activerecord (4.2.4) + activemodel (= 4.2.4) + activesupport (= 4.2.4) arel (~> 6.0) - activesupport (4.2.3) + activesupport (4.2.4) i18n (~> 0.7) json (~> 1.7, >= 1.7.7) minitest (~> 5.1) thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) addressable (2.3.8) - arel (6.0.2) + arel (6.0.3) bcrypt (3.1.10) - bourbon (4.2.3) + bourbon (4.2.5) sass (~> 3.4) - thor + thor (~> 0.19) builder (3.2.2) - capybara (2.4.4) + capybara (2.5.0) mime-types (>= 1.16) nokogiri (>= 1.3.3) rack (>= 1.0.0) @@ -108,7 +106,7 @@ GEM multi_json (~> 1.7, ~> 1.0) rest-client (~> 1.8.0) daemons (1.2.3) - devise (3.5.1) + devise (3.5.2) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 3.2.6, < 5) @@ -121,55 +119,57 @@ GEM email_validator (1.6.0) activemodel erubis (2.7.0) - eventmachine (1.0.7) - execjs (2.5.2) + eventmachine (1.0.8) + execjs (2.6.0) factory_girl (4.5.0) activesupport (>= 3.0.0) factory_girl_rails (4.5.0) factory_girl (~> 4.5.0) railties (>= 3.0.0) - font-awesome-rails (4.3.0.0) + font-awesome-rails (4.4.0.0) railties (>= 3.2, < 5.0) foundation-rails (5.5.2.1) railties (>= 3.1.0) sass (>= 3.3.0, < 3.5) - globalid (0.3.5) + globalid (0.3.6) activesupport (>= 4.1.0) http-cookie (1.0.2) domain_name (~> 0.5) i18n (0.7.0) - jquery-rails (4.0.4) + jquery-rails (4.0.5) rails-dom-testing (~> 1.0) railties (>= 4.2.0) thor (>= 0.14, < 2.0) json (1.8.3) launchy (2.4.3) addressable (~> 2.3) - loofah (2.0.2) + loofah (2.0.3) nokogiri (>= 1.5.9) mail (2.6.3) mime-types (>= 1.16, < 3) method_source (0.8.2) - mime-types (2.6.1) + mime-types (2.6.2) + mimemagic (0.3.0) mini_portile (0.6.2) - minitest (5.7.0) + minitest (5.8.1) multi_json (1.11.2) netrc (0.10.3) nokogiri (1.6.6.2) mini_portile (~> 0.6.0) - paperclip (4.2.4) + paperclip (4.3.1) activemodel (>= 3.2.0) activesupport (>= 3.2.0) cocaine (~> 0.5.5) mime-types + mimemagic (= 0.3.0) pickadate-rails (3.5.6.0) railties (>= 3.1.0) - poltergeist (1.6.0) + poltergeist (1.7.0) capybara (~> 2.1) cliver (~> 0.3.1) multi_json (~> 1.0) websocket-driver (>= 0.2.0) - pry (0.10.1) + pry (0.10.2) coderay (~> 1.1.0) method_source (~> 0.8.1) slop (~> 3.4) @@ -178,28 +178,28 @@ GEM rack (1.6.4) rack-test (0.6.3) rack (>= 1.0) - rails (4.2.3) - actionmailer (= 4.2.3) - actionpack (= 4.2.3) - actionview (= 4.2.3) - activejob (= 4.2.3) - activemodel (= 4.2.3) - activerecord (= 4.2.3) - activesupport (= 4.2.3) + rails (4.2.4) + actionmailer (= 4.2.4) + actionpack (= 4.2.4) + actionview (= 4.2.4) + activejob (= 4.2.4) + activemodel (= 4.2.4) + activerecord (= 4.2.4) + activesupport (= 4.2.4) bundler (>= 1.3.0, < 2.0) - railties (= 4.2.3) + railties (= 4.2.4) sprockets-rails rails-deprecated_sanitizer (1.0.3) activesupport (>= 4.2.0.alpha) - rails-dom-testing (1.0.6) + rails-dom-testing (1.0.7) activesupport (>= 4.2.0.beta, < 5.0) nokogiri (~> 1.6.0) rails-deprecated_sanitizer (>= 1.0.1) rails-html-sanitizer (1.0.2) loofah (~> 2.0) - railties (4.2.3) - actionpack (= 4.2.3) - activesupport (= 4.2.3) + railties (4.2.4) + actionpack (= 4.2.4) + activesupport (= 4.2.4) rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) rake (10.4.2) @@ -229,13 +229,13 @@ GEM rspec-mocks (~> 3.3.0) rspec-support (~> 3.3.0) rspec-support (3.3.0) - sass (3.4.16) - sass-rails (5.0.3) + sass (3.4.18) + sass-rails (5.0.4) railties (>= 4.0.0, < 5.0) sass (~> 3.1) sprockets (>= 2.8, < 4.0) sprockets-rails (>= 2.0, < 4.0) - tilt (~> 1.1) + tilt (>= 1.1, < 3) slim (3.0.6) temple (~> 0.7.3) tilt (>= 1.3.3, < 2.1) @@ -246,21 +246,21 @@ GEM railties (>= 3.1, < 5.0) slim (~> 3.0) slop (3.6.0) - sprockets (3.2.0) - rack (~> 1.0) - sprockets-rails (2.3.2) + sprockets (3.3.5) + rack (> 1, < 3) + sprockets-rails (2.3.3) actionpack (>= 3.0) activesupport (>= 3.0) sprockets (>= 2.8, < 4.0) temple (0.7.6) - thin (1.6.3) + thin (1.6.4) daemons (~> 1.0, >= 1.0.9) - eventmachine (~> 1.0) + eventmachine (~> 1.0, >= 1.0.4) rack (~> 1.0) thor (0.19.1) thread_safe (0.3.5) - tilt (1.4.1) - tinymce-rails (4.2.1) + tilt (2.0.1) + tinymce-rails (4.2.5) railties (>= 3.1.1) tzinfo (1.2.2) thread_safe (~> 0.1) @@ -280,7 +280,6 @@ PLATFORMS DEPENDENCIES ace-rails-ap - actionpack-page_caching bourbon capybara cmtool! diff --git a/app/helpers/cmtool/application_helper.rb b/app/helpers/cmtool/application_helper.rb index b4d9725..a061ec4 100644 --- a/app/helpers/cmtool/application_helper.rb +++ b/app/helpers/cmtool/application_helper.rb @@ -131,16 +131,27 @@ module Cmtool end def edit_td(obj) + path = case obj + when Array then edit_polymorphic_path(obj) + when SimplyStored::Couch then edit_polymorphic_path([cmtool, obj]) + else obj + end content_tag( :td, - link_to((content_tag(:span, '', class: [:edit, 'fa fa-lg fa-pencil'])), cmtool.url_for([:edit, obj]), class: 'tiny warning button'), + link_to((content_tag(:span, '', class: [:edit, 'fa fa-lg fa-pencil'])), path, class: 'tiny warning button'), class: [:action, :edit] ) end + def destroy_td(obj) + path = case obj + when Array then polymorphic_path(obj) + when SimplyStored::Couch then polymorphic_path([cmtool, obj]) + else obj + end content_tag( :td, - link_to(content_tag(:span, '', class: [:destroy, 'fa fa-lg fa-trash']), cmtool.url_for(obj), method: :delete, class: 'tiny alert button', data: {confirm: are_you_sure(obj) }), + link_to(content_tag(:span, '', class: [:destroy, 'fa fa-lg fa-trash']), path, method: :delete, class: 'tiny alert button', data: {confirm: are_you_sure(obj) }), class: [:action, :destroy] ) end