view_assets 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +31 -1
- data/lib/tasks/view_assets_tasks.rake +1 -1
- data/lib/view_assets.rb +4 -0
- data/lib/view_assets/version.rb +1 -1
- metadata +1 -1
data/README.rdoc
CHANGED
@@ -1,3 +1,33 @@
|
|
1
|
-
|
1
|
+
ViewAssets
|
2
|
+
==========
|
3
|
+
|
4
|
+
Simple Introductin
|
5
|
+
------------------
|
6
|
+
|
7
|
+
A new method to manage assets in a rails project.
|
8
|
+
|
9
|
+
Instead of using the default assets managing style in rails 3.2, this gem will introduce a new way to manage your assets. This is still a prototype, the fullfledged version will publish soon.
|
10
|
+
|
11
|
+
Conventions/Rules
|
12
|
+
-----------------
|
13
|
+
|
14
|
+
Usage
|
15
|
+
-----
|
16
|
+
|
17
|
+
Include this gem in your `helpers/application_helper.rb`
|
18
|
+
|
19
|
+
```ruby
|
20
|
+
module ApplicationHelper
|
21
|
+
include ViewAssets
|
22
|
+
end
|
23
|
+
```
|
24
|
+
|
25
|
+
Add some other codes in your `views/layouts/application.html.rb`
|
26
|
+
|
27
|
+
```ruby
|
28
|
+
<%= include_assets_with_assets_mvc(params[:controller], params[:action]) %>
|
29
|
+
```
|
30
|
+
|
31
|
+
If some of your controllers use their own layout file, and following rules in ViewAssets, then you should add that code above too.
|
2
32
|
|
3
33
|
This project rocks and uses MIT-LICENSE.
|
data/lib/view_assets.rb
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
##
|
2
2
|
# TODO documentation
|
3
3
|
module ViewAssets
|
4
|
+
# todo figure out why can't use require in this case
|
5
|
+
# todo find another way to include rake tasks, this method seems weird.
|
6
|
+
load 'tasks/view_assets_tasks.rake' if defined?(Rake)
|
7
|
+
|
4
8
|
require 'pathname'
|
5
9
|
|
6
10
|
require 'view_assets/error'
|
data/lib/view_assets/version.rb
CHANGED