chili 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -1
- data/README.md +21 -20
- data/chili.gemspec +1 -1
- data/lib/chili/extensions/rails/engine.rb +1 -1
- data/lib/chili/overrides.rb +2 -4
- data/lib/chili/tasks.rb +0 -8
- data/lib/chili/template.rb +1 -1
- data/lib/chili/version.rb +1 -1
- data/spec/dummy/{chili_likes/app/assets/images/chili_likes → chili_social/app/assets/images/chili_social}/.gitkeep +0 -0
- data/spec/dummy/{chili_likes/app/assets/javascripts/chili_likes → chili_social/app/assets/javascripts/chili_social}/application.js +0 -0
- data/spec/dummy/{chili_likes/app/assets/stylesheets/chili_likes → chili_social/app/assets/stylesheets/chili_social}/application.css.scss +0 -0
- data/spec/dummy/chili_social/app/controllers/chili_social/likes_controller.rb +14 -0
- data/spec/dummy/{chili_likes/app/models/chili_likes → chili_social/app/models/chili_social}/like.rb +1 -1
- data/spec/dummy/{chili_likes/app/models/chili_likes → chili_social/app/models/chili_social}/post.rb +1 -1
- data/spec/dummy/{chili_likes/app/models/chili_likes → chili_social/app/models/chili_social}/user.rb +1 -1
- data/spec/dummy/chili_social/app/overrides/layouts/application/stylesheets.html.erb.deface +2 -0
- data/spec/dummy/{chili_likes/app/overrides/posts/_post/chili_likes.html.erb.deface → chili_social/app/overrides/posts/_post/like_actions.html.erb.deface} +2 -2
- data/spec/dummy/chili_social/app/overrides/posts/index/disclaimer.html.erb.deface +2 -0
- data/spec/dummy/chili_social/app/overrides/posts/index/like_links.html.erb.deface +2 -0
- data/spec/dummy/{chili_likes/app/views/chili_likes → chili_social/app/views/chili_social}/likes/index.html.erb +0 -0
- data/spec/dummy/chili_social/config/routes.rb +4 -0
- data/spec/dummy/{chili_likes → chili_social}/db/migrate/20120513031021_create_chili_likes_likes.rb +0 -0
- data/spec/dummy/{chili_likes/lib/chili_likes.rb → chili_social/lib/chili_social.rb} +2 -2
- data/spec/dummy/{chili_likes/lib/chili_likes → chili_social/lib/chili_social}/engine.rb +2 -2
- data/spec/dummy/main_app/config/application.rb +1 -1
- data/spec/dummy/main_app/config/boot.rb +1 -1
- data/spec/dummy/main_app/config/routes.rb +1 -4
- data/spec/dummy/main_app/db/migrate/20120513032032_create_chili_social_likes.chili_likes.rb +11 -0
- data/spec/dummy/main_app/db/schema.rb +1 -1
- data/spec/requests/{chili_likes_spec.rb → chili_social_spec.rb} +3 -2
- metadata +53 -51
- data/spec/dummy/chili_likes/app/controllers/chili_likes/likes_controller.rb +0 -14
- data/spec/dummy/chili_likes/app/overrides/layouts/application/chili_likes.html.erb.deface +0 -2
- data/spec/dummy/chili_likes/app/overrides/posts/index/chili_likes.html.erb.deface +0 -2
- data/spec/dummy/chili_likes/config/routes.rb +0 -4
- data/spec/dummy/main_app/db/migrate/20120513032032_create_chili_likes_likes.chili_likes.rb +0 -11
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -19,14 +19,14 @@ Just like engines chili extensions are like mini apps that are created separatel
|
|
19
19
|
|
20
20
|
### Creating a new chili extension
|
21
21
|
|
22
|
-
Assuming you want to add a new extension that adds exposes a new "like" button feature to a subset of users, first run:
|
22
|
+
Assuming you want to add a new extension that adds exposes a new social feature such as a "like" button feature to a subset of users, first run:
|
23
23
|
|
24
|
-
chili
|
24
|
+
chili social # social is the name of the extension
|
25
25
|
|
26
26
|
This is basically a shortcut for running the `rails plugin new` engine generator with a custom template and will:
|
27
27
|
|
28
|
-
1. Create a directory named
|
29
|
-
2. Clone the app you are adding the extension to as a submodule into
|
28
|
+
1. Create a directory named chili_social containing the basic structure for the extension
|
29
|
+
2. Clone the app you are adding the extension to as a submodule into chili_social/main_app
|
30
30
|
3. Add a reference to the extensions gemspec to the main app gemfile for testing
|
31
31
|
|
32
32
|
### Define who can see the extension
|
@@ -35,8 +35,8 @@ Use the active_if block to control whether new controllers/overrides are visible
|
|
35
35
|
The context of the active_if block is the application controller so you can use any methods available to that.
|
36
36
|
|
37
37
|
```ruby
|
38
|
-
# lib/
|
39
|
-
module
|
38
|
+
# lib/chili_social.rb
|
39
|
+
module ChiliSocial
|
40
40
|
extend Chili::Activatable
|
41
41
|
active_if { logged_in? && current_user.admin? } # Extension is only visible to logged in admin users
|
42
42
|
end
|
@@ -44,19 +44,20 @@ end
|
|
44
44
|
|
45
45
|
### Modifying view templates in main app
|
46
46
|
|
47
|
-
Chili uses deface to modify existing view templates (see [deface docs](https://github.com/railsdog/deface#
|
48
|
-
Add
|
47
|
+
Chili uses deface to modify existing view templates (see [deface docs](https://github.com/railsdog/deface#using-the-deface-dsl-deface-files) for details)
|
48
|
+
Add overrides to the `app/overides` directory mirroing the path of the view you want to modify.
|
49
|
+
For example, assuming the main app has the partial `app/views/posts/_post.html.erb`:
|
49
50
|
|
50
51
|
```erb
|
51
|
-
<% # app/overrides/posts/_post/
|
52
|
+
<% # app/overrides/posts/_post/like_button.html.erb.deface (folder should mirror main app view path) %>
|
52
53
|
<!-- insert_bottom 'tr' -->
|
53
|
-
<td><%= link_to 'Like!',
|
54
|
+
<td><%= link_to 'Like!', chili_social.likes_path(like: {post_id: post}), method: :post %></td>
|
54
55
|
```
|
55
56
|
|
56
57
|
### Adding new resources
|
57
58
|
|
58
|
-
Use `rails g scaffold Like` as usual when using engines. The new resource will be namespaced to
|
59
|
-
and automounted in the main app at `/
|
59
|
+
Use `rails g scaffold Like` as usual when using engines. The new resource will be namespaced to ChiliSocial::Like
|
60
|
+
and automounted in the main app at `/chili/social/likes`, but only accessible when active_if is true.
|
60
61
|
All the rules for using [engine-based models](http://railscasts.com/episodes/277-mountable-engines?view=asciicast) apply.
|
61
62
|
|
62
63
|
### Modifying existing models
|
@@ -65,8 +66,8 @@ Create a model with the same name as the one you want to modify: `rails g model
|
|
65
66
|
and inherit from the original:
|
66
67
|
|
67
68
|
```ruby
|
68
|
-
# app/model/
|
69
|
-
module
|
69
|
+
# app/model/chili_social/user.rb
|
70
|
+
module ChiliSocial
|
70
71
|
class User < ::User
|
71
72
|
has_many :likes
|
72
73
|
end
|
@@ -76,19 +77,19 @@ end
|
|
76
77
|
Access through the namespaced model:
|
77
78
|
|
78
79
|
```erb
|
79
|
-
<%=
|
80
|
-
<%= current_user.becomes(
|
80
|
+
<%= ChiliSocial::User.first.likes %>
|
81
|
+
<%= current_user.becomes(ChiliSocial::User).likes %>
|
81
82
|
```
|
82
83
|
|
83
84
|
### Adding new stylesheets/javascripts
|
84
85
|
|
85
|
-
Add files as usual in `app/assets/
|
86
|
+
Add files as usual in `app/assets/chili_social/javascripts|stylesheets` and inject them into the layout using an override:
|
86
87
|
|
87
88
|
```erb
|
88
|
-
<% # app/overrides/layouts/application/
|
89
|
+
<% # app/overrides/layouts/application/assets.html.erb.deface %>
|
89
90
|
<!-- insert_bottom 'head' -->
|
90
|
-
<%= stylesheet_link_tag '
|
91
|
-
<%= javascript_include_tag '
|
91
|
+
<%= stylesheet_link_tag 'chili_social/application' %>
|
92
|
+
<%= javascript_include_tag 'chili_social/application' %>
|
92
93
|
```
|
93
94
|
|
94
95
|
### Gotchas
|
data/chili.gemspec
CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |gem|
|
|
15
15
|
gem.require_paths = ["lib"]
|
16
16
|
gem.version = Chili::VERSION
|
17
17
|
|
18
|
-
gem.add_dependency "rails", "~> 3.
|
18
|
+
gem.add_dependency "rails", "~> 3.2"
|
19
19
|
gem.add_development_dependency 'rspec', '~> 2.9.0'
|
20
20
|
gem.add_development_dependency 'rspec-rails', '~> 2.9.0'
|
21
21
|
gem.add_development_dependency 'jquery-rails'
|
data/lib/chili/overrides.rb
CHANGED
@@ -7,10 +7,8 @@ module Chili
|
|
7
7
|
|
8
8
|
module InstanceMethods
|
9
9
|
def activate_overrides
|
10
|
-
Deface::Override.all.each do |
|
11
|
-
|
12
|
-
override = o.second.first.second
|
13
|
-
override.args[:disabled] = !engine.active?(self)
|
10
|
+
Deface::Override.all.values.map(&:values).flatten.each do |override|
|
11
|
+
override.args[:disabled] = !override.railtie.class.parent.active?(self)
|
14
12
|
end
|
15
13
|
end
|
16
14
|
end
|
data/lib/chili/tasks.rb
CHANGED
@@ -1,12 +1,5 @@
|
|
1
1
|
module Chili
|
2
2
|
module Tasks
|
3
|
-
# Bundler
|
4
|
-
begin
|
5
|
-
require 'bundler/setup'
|
6
|
-
rescue LoadError
|
7
|
-
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
8
|
-
end
|
9
|
-
|
10
3
|
# App tasks
|
11
4
|
require 'rails'
|
12
5
|
load 'rails/tasks/engine.rake'
|
@@ -14,6 +7,5 @@ module Chili
|
|
14
7
|
# Gem tasks
|
15
8
|
require 'bundler/gem_helper'
|
16
9
|
Bundler::GemHelper.install_tasks
|
17
|
-
|
18
10
|
end
|
19
11
|
end
|
data/lib/chili/template.rb
CHANGED
data/lib/chili/version.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module ChiliSocial
|
2
|
+
class LikesController < Chili::ApplicationController
|
3
|
+
|
4
|
+
def index
|
5
|
+
@likes = current_user.becomes(ChiliSocial::User).likes
|
6
|
+
end
|
7
|
+
|
8
|
+
def create
|
9
|
+
@like = current_user.becomes(ChiliSocial::User).likes.create!(params[:like])
|
10
|
+
redirect_to :back, notice: 'Post liked!'
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
14
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<!-- insert_bottom 'tr' -->
|
2
|
-
<% post.becomes(
|
3
|
-
<td><%= link_to 'Like!',
|
2
|
+
<% post.becomes(ChiliSocial::Post).tap do |post| %>
|
3
|
+
<td><%= link_to 'Like!', chili_social.likes_path(like: {post_id: post}), method: :post %></td>
|
4
4
|
<td><%= pluralize post.likes.size, 'like' %></td>
|
5
5
|
<td><%= post.well_liked? ? 'This post is well liked!' : 'This post is boring...' %></td>
|
6
6
|
<% end %>
|
File without changes
|
data/spec/dummy/{chili_likes → chili_social}/db/migrate/20120513031021_create_chili_likes_likes.rb
RENAMED
File without changes
|
@@ -1,6 +1,6 @@
|
|
1
|
-
module
|
1
|
+
module ChiliSocial
|
2
2
|
class Engine < ::Rails::Engine
|
3
|
-
isolate_namespace
|
3
|
+
isolate_namespace ChiliSocial
|
4
4
|
config.generators do |g|
|
5
5
|
g.scaffold_controller :chili
|
6
6
|
g.test_framework :rspec, view_specs: false, routing_specs: false, controller_specs: false
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# This migration comes from chili_social (originally 20120513031021)
|
2
|
+
class CreateChiliSocialLikes < ActiveRecord::Migration
|
3
|
+
def change
|
4
|
+
create_table :chili_social_likes do |t|
|
5
|
+
t.integer :post_id
|
6
|
+
t.integer :user_id
|
7
|
+
|
8
|
+
t.timestamps
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -13,7 +13,7 @@
|
|
13
13
|
|
14
14
|
ActiveRecord::Schema.define(:version => 20120513032032) do
|
15
15
|
|
16
|
-
create_table "
|
16
|
+
create_table "chili_social_likes", :force => true do |t|
|
17
17
|
t.integer "post_id"
|
18
18
|
t.integer "user_id"
|
19
19
|
t.datetime "created_at", :null => false
|
@@ -5,6 +5,7 @@ feature 'View overrides' do
|
|
5
5
|
User.create!
|
6
6
|
visit('/posts')
|
7
7
|
page.should_not have_content('See Your Likes')
|
8
|
+
page.should_not have_content('Like functionality is in beta')
|
8
9
|
end
|
9
10
|
|
10
11
|
scenario 'when admin active_if toggles overrides on' do
|
@@ -17,12 +18,12 @@ end
|
|
17
18
|
feature 'Togglable controllers' do
|
18
19
|
scenario 'when user is not admin active_if hides engine controller' do
|
19
20
|
User.create!
|
20
|
-
expect { visit('/
|
21
|
+
expect { visit('/chili/social/likes') }.to raise_error(ActionController::RoutingError)
|
21
22
|
end
|
22
23
|
|
23
24
|
scenario 'when admin active_if toggles overrides on' do
|
24
25
|
User.create!(admin: true)
|
25
|
-
visit('/
|
26
|
+
visit('/chili/social/likes')
|
26
27
|
page.should have_content('Your Likes')
|
27
28
|
end
|
28
29
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chili
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,22 +9,22 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-05-
|
12
|
+
date: 2012-05-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
16
|
-
requirement: &
|
16
|
+
requirement: &70323199401800 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: '3.
|
21
|
+
version: '3.2'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70323199401800
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rspec
|
27
|
-
requirement: &
|
27
|
+
requirement: &70323199401280 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 2.9.0
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70323199401280
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rspec-rails
|
38
|
-
requirement: &
|
38
|
+
requirement: &70323199400820 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 2.9.0
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70323199400820
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: jquery-rails
|
49
|
-
requirement: &
|
49
|
+
requirement: &70323199400420 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70323199400420
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: capybara
|
60
|
-
requirement: &
|
60
|
+
requirement: &70323199399860 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70323199399860
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: sqlite3
|
71
|
-
requirement: &
|
71
|
+
requirement: &70323199399440 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,7 +76,7 @@ dependencies:
|
|
76
76
|
version: '0'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *70323199399440
|
80
80
|
description: The spicy extension framework (work in progress)
|
81
81
|
email:
|
82
82
|
- jens@balvig.com
|
@@ -103,21 +103,22 @@ files:
|
|
103
103
|
- lib/chili/version.rb
|
104
104
|
- lib/generators/rails/chili_generator.rb
|
105
105
|
- lib/generators/rails/templates/controller.rb
|
106
|
-
- spec/dummy/
|
107
|
-
- spec/dummy/
|
108
|
-
- spec/dummy/
|
109
|
-
- spec/dummy/
|
110
|
-
- spec/dummy/
|
111
|
-
- spec/dummy/
|
112
|
-
- spec/dummy/
|
113
|
-
- spec/dummy/
|
114
|
-
- spec/dummy/
|
115
|
-
- spec/dummy/
|
116
|
-
- spec/dummy/
|
117
|
-
- spec/dummy/
|
118
|
-
- spec/dummy/
|
119
|
-
- spec/dummy/
|
120
|
-
- spec/dummy/
|
106
|
+
- spec/dummy/chili_social/app/assets/images/chili_social/.gitkeep
|
107
|
+
- spec/dummy/chili_social/app/assets/javascripts/chili_social/application.js
|
108
|
+
- spec/dummy/chili_social/app/assets/stylesheets/chili_social/application.css.scss
|
109
|
+
- spec/dummy/chili_social/app/controllers/chili_social/likes_controller.rb
|
110
|
+
- spec/dummy/chili_social/app/models/chili_social/like.rb
|
111
|
+
- spec/dummy/chili_social/app/models/chili_social/post.rb
|
112
|
+
- spec/dummy/chili_social/app/models/chili_social/user.rb
|
113
|
+
- spec/dummy/chili_social/app/overrides/layouts/application/stylesheets.html.erb.deface
|
114
|
+
- spec/dummy/chili_social/app/overrides/posts/_post/like_actions.html.erb.deface
|
115
|
+
- spec/dummy/chili_social/app/overrides/posts/index/disclaimer.html.erb.deface
|
116
|
+
- spec/dummy/chili_social/app/overrides/posts/index/like_links.html.erb.deface
|
117
|
+
- spec/dummy/chili_social/app/views/chili_social/likes/index.html.erb
|
118
|
+
- spec/dummy/chili_social/config/routes.rb
|
119
|
+
- spec/dummy/chili_social/db/migrate/20120513031021_create_chili_likes_likes.rb
|
120
|
+
- spec/dummy/chili_social/lib/chili_social.rb
|
121
|
+
- spec/dummy/chili_social/lib/chili_social/engine.rb
|
121
122
|
- spec/dummy/main_app/README.rdoc
|
122
123
|
- spec/dummy/main_app/Rakefile
|
123
124
|
- spec/dummy/main_app/app/assets/javascripts/application.js
|
@@ -165,7 +166,7 @@ files:
|
|
165
166
|
- spec/dummy/main_app/config/routes.rb
|
166
167
|
- spec/dummy/main_app/db/migrate/20120513023816_create_posts.rb
|
167
168
|
- spec/dummy/main_app/db/migrate/20120513023840_create_users.rb
|
168
|
-
- spec/dummy/main_app/db/migrate/
|
169
|
+
- spec/dummy/main_app/db/migrate/20120513032032_create_chili_social_likes.chili_likes.rb
|
169
170
|
- spec/dummy/main_app/db/schema.rb
|
170
171
|
- spec/dummy/main_app/lib/assets/.gitkeep
|
171
172
|
- spec/dummy/main_app/log/.gitkeep
|
@@ -175,7 +176,7 @@ files:
|
|
175
176
|
- spec/dummy/main_app/public/favicon.ico
|
176
177
|
- spec/dummy/main_app/script/rails
|
177
178
|
- spec/lib/chili/activatable_spec.rb
|
178
|
-
- spec/requests/
|
179
|
+
- spec/requests/chili_social_spec.rb
|
179
180
|
- spec/spec_helper.rb
|
180
181
|
homepage: https://github.com/balvig/chili
|
181
182
|
licenses: []
|
@@ -191,7 +192,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
191
192
|
version: '0'
|
192
193
|
segments:
|
193
194
|
- 0
|
194
|
-
hash:
|
195
|
+
hash: 4584259311276612351
|
195
196
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
196
197
|
none: false
|
197
198
|
requirements:
|
@@ -200,7 +201,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
200
201
|
version: '0'
|
201
202
|
segments:
|
202
203
|
- 0
|
203
|
-
hash:
|
204
|
+
hash: 4584259311276612351
|
204
205
|
requirements: []
|
205
206
|
rubyforge_project:
|
206
207
|
rubygems_version: 1.8.11
|
@@ -208,21 +209,22 @@ signing_key:
|
|
208
209
|
specification_version: 3
|
209
210
|
summary: The spicy extension framework (work in progress)
|
210
211
|
test_files:
|
211
|
-
- spec/dummy/
|
212
|
-
- spec/dummy/
|
213
|
-
- spec/dummy/
|
214
|
-
- spec/dummy/
|
215
|
-
- spec/dummy/
|
216
|
-
- spec/dummy/
|
217
|
-
- spec/dummy/
|
218
|
-
- spec/dummy/
|
219
|
-
- spec/dummy/
|
220
|
-
- spec/dummy/
|
221
|
-
- spec/dummy/
|
222
|
-
- spec/dummy/
|
223
|
-
- spec/dummy/
|
224
|
-
- spec/dummy/
|
225
|
-
- spec/dummy/
|
212
|
+
- spec/dummy/chili_social/app/assets/images/chili_social/.gitkeep
|
213
|
+
- spec/dummy/chili_social/app/assets/javascripts/chili_social/application.js
|
214
|
+
- spec/dummy/chili_social/app/assets/stylesheets/chili_social/application.css.scss
|
215
|
+
- spec/dummy/chili_social/app/controllers/chili_social/likes_controller.rb
|
216
|
+
- spec/dummy/chili_social/app/models/chili_social/like.rb
|
217
|
+
- spec/dummy/chili_social/app/models/chili_social/post.rb
|
218
|
+
- spec/dummy/chili_social/app/models/chili_social/user.rb
|
219
|
+
- spec/dummy/chili_social/app/overrides/layouts/application/stylesheets.html.erb.deface
|
220
|
+
- spec/dummy/chili_social/app/overrides/posts/_post/like_actions.html.erb.deface
|
221
|
+
- spec/dummy/chili_social/app/overrides/posts/index/disclaimer.html.erb.deface
|
222
|
+
- spec/dummy/chili_social/app/overrides/posts/index/like_links.html.erb.deface
|
223
|
+
- spec/dummy/chili_social/app/views/chili_social/likes/index.html.erb
|
224
|
+
- spec/dummy/chili_social/config/routes.rb
|
225
|
+
- spec/dummy/chili_social/db/migrate/20120513031021_create_chili_likes_likes.rb
|
226
|
+
- spec/dummy/chili_social/lib/chili_social.rb
|
227
|
+
- spec/dummy/chili_social/lib/chili_social/engine.rb
|
226
228
|
- spec/dummy/main_app/README.rdoc
|
227
229
|
- spec/dummy/main_app/Rakefile
|
228
230
|
- spec/dummy/main_app/app/assets/javascripts/application.js
|
@@ -270,7 +272,7 @@ test_files:
|
|
270
272
|
- spec/dummy/main_app/config/routes.rb
|
271
273
|
- spec/dummy/main_app/db/migrate/20120513023816_create_posts.rb
|
272
274
|
- spec/dummy/main_app/db/migrate/20120513023840_create_users.rb
|
273
|
-
- spec/dummy/main_app/db/migrate/
|
275
|
+
- spec/dummy/main_app/db/migrate/20120513032032_create_chili_social_likes.chili_likes.rb
|
274
276
|
- spec/dummy/main_app/db/schema.rb
|
275
277
|
- spec/dummy/main_app/lib/assets/.gitkeep
|
276
278
|
- spec/dummy/main_app/log/.gitkeep
|
@@ -280,5 +282,5 @@ test_files:
|
|
280
282
|
- spec/dummy/main_app/public/favicon.ico
|
281
283
|
- spec/dummy/main_app/script/rails
|
282
284
|
- spec/lib/chili/activatable_spec.rb
|
283
|
-
- spec/requests/
|
285
|
+
- spec/requests/chili_social_spec.rb
|
284
286
|
- spec/spec_helper.rb
|
@@ -1,14 +0,0 @@
|
|
1
|
-
module ChiliLikes
|
2
|
-
class LikesController < Chili::ApplicationController
|
3
|
-
|
4
|
-
def index
|
5
|
-
@likes = current_user.becomes(ChiliLikes::User).likes
|
6
|
-
end
|
7
|
-
|
8
|
-
def create
|
9
|
-
@like = current_user.becomes(ChiliLikes::User).likes.create!(params[:like])
|
10
|
-
redirect_to :back, notice: 'Post liked!'
|
11
|
-
end
|
12
|
-
|
13
|
-
end
|
14
|
-
end
|