AsyncDataFetch

This project uses MIT-LICENSE.


To use:

In your gemfile

gem ‘gui_foldable_content’


In application.js

//= require gui_foldable_content


In config/initializers/gui_foldable_content.rb

| GuiFoldableContent.configure do |config| | config.default_close_indicator = ‘UP’ | config.default_open_indicator = ‘DOWN’ | end

So you can configure the default indicator across your application.

  • default_close_indicator is the indicator on the side of the title when the block is closed. Default: ‘[C]’.

  • default_open_indicator is the indicator on the side of the title when the block is open. Default: ‘[O]’.


In your views, user the helper:

<%= create_foldable_area(title: ‘TITLE’, title_tag: ‘h3’, default_state: false, close_indicator: simple_format(‘plop’, {}, wrapper_tag: ‘span’ ), open_indicator: ‘down’ ) do %>

SOME HTML CONTENT

<% end %>

  • title is the clickable table of the block.

  • title_tag is the tag surrounding the title. Default: ‘h3’.

  • default_state is state of the block when the page load. Default: false (means closed)

  • close_indicator is the indicator on the side of the title when the block is closed. Default: ‘[C]’.

  • open_indicator is the indicator on the side of the title when the block is open. Default: ‘[O]’.