Project

scajax

0.0
No commit activity in last 3 years
No release in over 3 years
Simply ajaxify your scaffold
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
~> 3.2.0
>= 0
 Project Readme

Scajax Build Status Gem Version

This gem quickly adds a basic ajax functionality to generated scaffold in rails.

Installation

Add this line to your application's Gemfile:

gem 'scajax'

or for the latest version of the gem add:

gem 'scajax', git: 'git@github.com:menuitem/scajax.git'

And then execute bundle:

$ bundle

Also you can install it yourself in your system gems as:

$ gem install scajax

Usage

$ rails g scajax [RESOURCE_NAME]

Quick Simple Example:

  1. Add scajax to your application's Gemfile:

     gem 'scajax'
    
  2. Run 'bundle' to install this gem in your project:

     $ bundle
    
  3. Generate new scaffold called e.g. posts:

     $ rails generate scaffold post title body:text published:boolean
    
  4. Don't forget to run migration:

     $ rake db:migrate
    
  5. Generate ajax for posts scaffold with scajax generator:

     $ rails g scajax post
    

Open your project in a browser.

Quick Example with twitter-bootstrap:

  1. Add to your application's Gemfile:

     gem 'scajax'
     gem 'twitter-bootstrap-rails'
    
  2. Run 'bundle' to install gems in your project:

     $ bundle
    
  3. Install twitter-bootstrap:

     $ rails generate bootstrap:install static
    
  4. Generate new scaffold called e.g. posts:

     $ rails generate scaffold post title body:text published:boolean --no-stylesheets
    
  5. Don't forget to run migration:

     $ rake db:migrate
    
  6. Generate boootstrap themed for posts

     $ rails g bootstrap:themed posts
    
  7. Generate ajax for posts scaffold with scajax generator

     $ rails g scajax post
    

Open your project in a browser.

(8) If you have somehow file 'scaffolds.css.scss' and you don't use it just delete it:

$ rm app/assets/stylesheets/scaffolds.css.scss

Refresh your browser (F5).

Quick Example with zurb-foundation:

  1. Add to your application's Gemfile:

     gem 'scajax'
     gem 'zurb-foundation'
    
  2. And run 'bundle' to install gems in your project:

     $ bundle
    
  3. Install zurb-foundation:

     $ rails g foundation:install
    
  4. Generate new scaffold called e.g. posts:

     $ rails generate scaffold post title body:text published:boolean --no-styelsheets
    
  5. Don't forget to run migration:

     $ rake db:migrate
    
  6. Generate ajax for posts scaffold with scajax generator:

     $ rails g scajax post
    

Open your project in a browser.

(7) If you have somehow file 'scaffolds.css.scss' and you don't use it just delete it:

$ rm app/assets/stylesheets/scaffolds.css.scss

Refresh your browser (F5).

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request