Giter VIP home page Giter VIP logo

view_assets's Introduction

ViewAssets Build Status

A new method to manage assets in a rails project. 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 only a prototype of the whole project, the fullfledged version will publish soon. It works like assetpipeline, but comes with different conventions. It doesn't include all your assets simply even if you have view/page or controller specific assets. It is page-specific.

Conventions/Rules

According to ViewAssets, there are three folders in /public folder:

* vendor
* lib
* app

Each sence of them are the same as in rails3 assetpipeline.

DIRECTIVES

for javascript double-slash syntax => "//= require_vendor xxx" space-asterisk syntax => " = require_vendor xxx" slash-asterisk syntax => "/= require_vendor xxx */"

for stylesheets space-asterisk syntax => " = require_vendor xxx" slash-asterisk syntax => "/= require_vendor xxx */"

Usage

First, include ViewAssets in helpers/application_helper.rb

module ApplicationHelper
  include ViewAssets
end

Add some other codes in your views/layouts/application.html.rb

<%= include_assets_with_assets_mvc(params[:controller], params[:action]) %>

If some of your controllers use their own layout file, and following rules in ViewAssets, then you should add that code above too.

This project rocks and uses MIT-LICENSE.

view_assets's People

Contributors

bom-d-van avatar mrzou avatar

Stargazers

 avatar

Watchers

 avatar James Cloos avatar  avatar

view_assets's Issues

rake va:init 出现了下面的错误

init asset folders in /public: rake aborted! TypeError: wrong argument type Pathname (expected Regexp) /home/mrzou/.rvm/gems/ruby-1.9.3-p374/gems/view_assets-1.1.1/lib/tasks/basic.rb:17:in `gsub' /home/mrzou/.rvm/gems/ruby-1.9.3-p374/gems/view_assets-1.1.1/lib/tasks/basic.rb:17:in`block (3 levels) in ' /home/mrzou/.rvm/gems/ruby-1.9.3-p374/gems/view_assets-1.1.1/lib/tasks/basic.rb:15:in `each' /home/mrzou/.rvm/gems/ruby-1.9.3-p374/gems/view_assets-1.1.1/lib/tasks/basic.rb:15:in`block (2 levels) in ' Tasks: TOP => va:init (See full trace by running task with --trace)

undefined method `exitstatus' for nil:NilClass

undefined method exitstatus' for nil:NilClass /home/ce/.rvm/gems/ruby-1.9.3-p429/gems/term-ansicolor-1.1.1/lib/term/ansicolor.rb:121:inmethod_missing'
/home/ce/.rvm/gems/ruby-1.9.3-p429/gems/yui-compressor-0.9.6/lib/yui/compressor.rb:84:in block in compress' /home/ce/.rvm/gems/ruby-1.9.3-p429/gems/yui-compressor-0.9.6/lib/yui/compressor.rb:117:instreamify'
/home/ce/.rvm/gems/ruby-1.9.3-p429/gems/yui-compressor-0.9.6/lib/yui/compressor.rb:66:in compress' /home/ce/.rvm/gems/ruby-1.9.3-p429/gems/view_assets-1.0.4/lib/view_assets/packager/packager.rb:84:incompress'
/home/ce/.rvm/gems/ruby-1.9.3-p429/gems/view_assets-1.0.4/lib/view_assets/packager/packager.rb:66:in meta_package' /home/ce/.rvm/gems/ruby-1.9.3-p429/gems/view_assets-1.0.4/lib/view_assets/packager/packager.rb:23:inpackage'
/home/ce/.rvm/gems/ruby-1.9.3-p429/gems/view_assets-1.0.4/lib/tasks/basic.rb:33:in `block (2 levels) in <top (required)>'
Tasks: TOP => va:compress
(See full trace by running task with --trace)

在服务器上会出现这种问题。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.