bootstrap2-rails 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,18 +1,14 @@
1
1
  == bootstrap2-rails gem
2
- Warning: this gem is under development, bugs are present.
2
+ Warning: this gem is under development, bugs are present. Works only with Rails > 3.0
3
3
 
4
4
  This gem replaces Rails default scaffold to create views based on Bootstrap 2, from Twitter (http://twitter.github.com/bootstrap). There is also a toast message feature based on JQuery Toast Message plugin.
5
5
 
6
6
  When installed, this gem overrides Rails default scaffold templates, which means that any call to scaffold generator will use the gem templates. The views also are generated with some others features like search and sort.
7
7
  There is also a dropdown menu generator to avoid manual menu creation.
8
8
 
9
- === Building gem
10
- After downloading project folder, run this command on root folder to make a gem file inside pkg folder:
11
- rake build
12
-
13
9
  === Installation
14
10
  You can use this gem with only Rails 3. Include this line inside your Gemfile:
15
- gem 'bootstrap2-rails', :path => '/path/to/gemfolder'
11
+ gem 'bootstrap2-rails'
16
12
 
17
13
  Run the bundle command to install required gems in your Rails application:
18
14
  bundle
@@ -21,34 +17,37 @@ Run the bundle command to install required gems in your Rails application:
21
17
  After installing gem, run the views generator to copy some needed files (caution: it will override application.html.erb)
22
18
  rails generate bootstrap:views
23
19
 
24
- === Loading bootstrap CSS file
25
- Include this line in your app/assets/stylesheets/application.css file to load a required CSS file
26
- *= require bootstrap
20
+ === Loading bootstrap and JQuery Toast Message CSS files (required)
21
+ Include these lines in your app/assets/stylesheets/application.css file to load required CSS files
22
+ *= require bootstrap
23
+ *= require jquery.toastmessage
27
24
 
28
- === Toast messages
29
- Toast messages are notifications with an android-like visual. There are 4 types of toast messages: error, warning, notice and success. In order to use the toast-messages include this required line in your app/assets/javascripts/application.js file
30
- *= require jquery.toastmessage
25
+ Important: Rails default scaffold.css file overrides some CSS styles. So delete scaffold.css file or clean it up to correct working of Bootstrap styles.
31
26
 
32
- And also this line for loading CSS in your app/assets/stylesheets/application.css file
33
- *= require jquery.toastmessage
27
+ === Loading bootstrap and JQuery Toast Message javascript files (required)
28
+ Include these lines in your app/assets/stylesheets/application.css file to load required CSS files
29
+ //= require bootstrap
30
+ //= require jquery.toastmessage
31
+
32
+ === Toast messages
33
+ Toast messages are notifications with an android-like visual. There are 4 types of toast messages: error, warning, notice and success.
34
34
 
35
35
  To show a toast message use this helper method
36
36
  display_toast_message(message, type)
37
37
 
38
- where message is the message text and type is one of the four types of messages (notice, error, success or warning)
38
+ where message is the message text and type is one of the four types of messages (notice, error, success or warning). Usage example:
39
39
 
40
- === Menu generator
41
- The menu generator creates a dropdown menu for your actions inside your controllers. There are three steps needed for creating a menu:
40
+ <%= display_toast_message('hello workd', 'notice') %>
42
41
 
43
- 1) Load a required javascript file by adding this line to your app/assets/javascripts/application.js
44
- //= require bootstrap-dropdown
42
+ === Menu generator (under development, not working)
43
+ The menu generator creates a dropdown menu for your actions inside your controllers. There are two steps needed for creating a menu:
45
44
 
46
- 2) Define wich items and subitems will be available. In a dropdown menu there is a main item and several subitems. The main item is only a text explaining the content (e.g. File, Window, Tools). The subitems are controller actions (e.g. New, Save, Close). To define the main item and corresponding subitems, insert this line in your application_controller.rb:
45
+ 1) Define wich items and subitems will be available. In a dropdown menu there is a main item and several subitems. The main item is only a text explaining the content (e.g. File, Window, Tools). The subitems are controller actions (e.g. New, Save, Close). To define the main item and corresponding subitems, insert this line in your application_controller.rb:
47
46
  menu_options [{:title => 'Index', :itens => [
48
47
  {:text => 'Projects', :controller => 'projects', :action => 'index'}
49
48
  ]}]
50
49
 
51
50
  The menu_options parameter is an array of hashes with 2 keys: title and itens. The title is the text of the main item and can be anything you want. The itens is an array of hashes, wich one with 3 keys: text (the subitem text), controller (the controller with the action) and action (the action itself).
52
51
 
53
- 3) Include a menu_bar call in your html page:
52
+ 2) Include a menu_bar call in your html page:
54
53
  <%= menu_bar %>
@@ -1,3 +1,3 @@
1
1
  module BootstrapRails
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bootstrap2-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-02-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: will_paginate
16
- requirement: &80901540 !ruby/object:Gem::Requirement
16
+ requirement: &69169280 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *80901540
24
+ version_requirements: *69169280
25
25
  description: This is a scaffold replacement with a Twitter Bootstrap look
26
26
  email:
27
27
  - stapait@gmail.com