Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A Rails Guilded component allowing a block of markup to be shown and hidden by toggling another control.
Ruby
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
rails_generators/toggle_block_assets
script
spec
tasks
History.txt
Manifest.txt
PostInstall.txt
README.rdoc
Rakefile
g_toggle_block.gemspec

README.rdoc

g_toggle_block

github.com/midas/g_toggle_block/tree/master

DESCRIPTION:

A Rails Guilded (github.com/midas/guilded/tree/master) component allowing a block of markup to be shown and hidden by toggling another control.

FEATURES:

  • Easily create a collapsible area that can be toggled using another HTML control or element.

USAGE:

This is just one possible use of the toggle block control. In this example we will be showing or hiding additional form fields based on a check box being checked.

# within form ...

<%= f.check_box "user[role_ids][]", role.id, @user.roles.include?(role), {:id => "toggle-optional-fields"} %> Role with Optional Fields

<% g_toggle_block :id => "optional-fields", :toggler_id => "toggle-cecbems-required" do %>
  <%= f.text_field :another_field_1 %>
  <%= f.text_field :another_field_2 %>
  # ...
<% end %>

REQUIREMENTS:

INSTALL:

sudo gem install midas-g_toggle_block

In rails environment.rb file:

config.gem 'midas-g_toggle_block', :version => "1.0.1", :lib => 'g_toggle_block', :source => 'http://gems.github.com'

Generate:

script/generate toggle_block_assets

LICENSE:

(The MIT License)

Copyright © 2009 C. Jason Harrelson (midas)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Something went wrong with that request. Please try again.