Code Monkey home page Code Monkey logo

content-slice's Introduction

ContentSlice
============

A slice for the Merb framework.

------------------------------------------------------------------------------
   

To see all available tasks for ContentSlice run:

rake -T slices:content_slice

------------------------------------------------------------------------------

Instructions for installation:

file: config/init.rb

# add the slice as a regular dependency

dependency 'content-slice'

# if needed, configure which slices to load and in which order

Merb::Plugins.config[:merb_slices] = { :queue => ["ContentSlice", ...] }

# optionally configure the plugins in a before_app_loads callback

Merb::BootLoader.before_app_loads do
  
  Merb::Slices::config[:content_slice][:option] = value
  
end

file: config/router.rb

# example: /content_slice/:controller/:action/:id

add_slice(:ContentSlice)

# example: /:lang/:controller/:action/:id

add_slice(:ContentSlice, :path => ':lang')

# example: /:controller/:action/:id

slice(:ContentSlice)

Normally you should also run the following rake task:

rake slices:content_slice:install

------------------------------------------------------------------------------

You can put your application-level overrides in:

host-app/slices/content-slice/app - controllers, models, views ...

Templates are located in this order:

1. host-app/slices/content-slice/app/views/*
2. gems/content-slice/app/views/*
3. host-app/app/views/*

You can use the host application's layout by configuring the
content-slice slice in a before_app_loads block:

Merb::Slices.config[:content_slice] = { :layout => :application }

By default :content_slice is used. If you need to override
stylesheets or javascripts, just specify your own files in your layout
instead/in addition to the ones supplied (if any) in 
host-app/public/slices/content-slice.

In any case don't edit those files directly as they may be clobbered any time
rake content_slice:install is run.

content-slice's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

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.