aspartame 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +24 -5
- data/lib/aspartame/engine.rb +13 -0
- data/lib/aspartame/version.rb +1 -1
- metadata +1 -1
data/README.md
CHANGED
@@ -2,8 +2,27 @@
|
|
2
2
|
|
3
3
|
Instructions:
|
4
4
|
|
5
|
-
1. Add 'aspartame' to gemfile.
|
6
|
-
2.
|
7
|
-
3.
|
8
|
-
4.
|
9
|
-
5. Add
|
5
|
+
1. Add 'aspartame' to gemfile and run bundle install.
|
6
|
+
2. Run ```rails generate formtastic:install``` to get the forms working properly afterward). Add to config/initializers/formtastic.rb ```Formtastic::Helpers::FormHelper.builder = FormtasticBootstrap::FormBuilder```
|
7
|
+
3. Run ```rake aspartame:install:migrations``` and then ```rake db:migrate```
|
8
|
+
4. Add ```mount Aspartame::Engine => "/aspartame"``` to main app's routes.rb.
|
9
|
+
5. Add ```*= require aspartame/application``` to main app's application.css file.
|
10
|
+
6. Make sure you have jquery_rails enabled.
|
11
|
+
7. Add ```<%= render 'layouts/aspartame/aspartame_header' %>``` at the top of the body of main app's application.html.erb file.
|
12
|
+
8. Add the following to your application_controller.rb:
|
13
|
+
|
14
|
+
```
|
15
|
+
before_filter :aspartame_form_variables
|
16
|
+
|
17
|
+
def aspartame_form_variables
|
18
|
+
@aspartame_translation = Aspartame::AspartameTranslation.new
|
19
|
+
if request.fullpath.index('?')
|
20
|
+
@aspartame_url_string = request.fullpath.slice(0...(request.fullpath.index('?')))
|
21
|
+
else
|
22
|
+
@aspartame_url_string = request.fullpath
|
23
|
+
end
|
24
|
+
@aspartame_universal_translations = Aspartame::AspartameTranslation.where(:url => "UNIVERSAL", :language => params[:ln], :status => true)
|
25
|
+
@aspartame_translations = Aspartame::AspartameTranslation.where(:url => @aspartame_url_string, :language => params[:ln], :status => true)
|
26
|
+
@aspartame_user = Aspartame::AspartameUser.find_by_remember_token(cookies[:aspartame_remember_token])
|
27
|
+
end
|
28
|
+
```
|
data/lib/aspartame/engine.rb
CHANGED
@@ -6,6 +6,19 @@ module Aspartame
|
|
6
6
|
helper Aspartame::ApplicationHelper
|
7
7
|
end
|
8
8
|
end
|
9
|
+
|
10
|
+
require 'rubygems'
|
11
|
+
require "jquery-rails"
|
12
|
+
require "bootstrap-sass"
|
13
|
+
require "formtastic"
|
14
|
+
require "formtastic-bootstrap"
|
15
|
+
require "will_paginate"
|
16
|
+
require "bootstrap-will_paginate"
|
17
|
+
require "bcrypt-ruby"
|
18
|
+
require "sass-rails"
|
19
|
+
require "jquery-datatables-rails"
|
20
|
+
require "jquery-ui-rails"
|
21
|
+
require "coffee-rails"
|
9
22
|
|
10
23
|
# initializer "aspartame.load_controller" do
|
11
24
|
# ActiveSupport.on_load(:action_controller) do
|
data/lib/aspartame/version.rb
CHANGED