Sha256: 66d96393571466e03727179920067f47c2e85ceb75872ab87ed1bdf4dc39027a

Contents?: true

Size: 1.76 KB

Versions: 4

Compression:

Stored size: 1.76 KB

Contents

= Commenteux

This is a mountable gem that add a presentation layer to acts_as_commentable.

Mount this gem into your app to automatically have access to screens that list and create comments on any of your resources.
Those screen will be inserted in your current app layout. You can call the routes of the gem with ajax passing a parent
div where you want the response to ben inserted.

Note that the presentation layer is based on bootstrap.

Also note that you must have acts_as_commentable installed and declared in your desired resources.

== Installation :

Add the following line to your Gemfile

=== Rails 4

  gem 'commenteux'

== Usage

Mount the commenteux gem in your routes:

  mount Commenteux::Engine => "/"

The routes that will be available are :

       GET  /commenteux/:resource/:resource_id(.:format)     commenteux/notes#index
       GET  /commenteux/:resource/:resource_id/new(.:format) commenteux/notes#new
       POST /commenteux/:resource/:resource_id(.:format)     commenteux/notes#create

where :resource is the name of your model (you can use namespace)

Call url of commenteux screens, for exemple, like that:

  <%= link_to "<i class='icon-file-text text-blue'></i> Notes".html_safe,
                "/commenteux/client::contract/#{@contract.id}?parent_div=ajax_target",
                :id => "notes_tab", :data => {:remote => true} %>

With a binding like that in your application.js

  $(document).delegate '#notes_tab', 'ajax:success', (e, data, status, xhr) ->
    console.log(xhr.responseText)
    $('.tab_header').removeClass('active')
    $('#notes_tab_header').addClass('active')
    $('#ajax_target').html(xhr.responseText)


== Credits

jackdempsey - The creator of acts_as_commentable.

== Contributors

seurdge, rgagnon

== More

http://www.groupefungo.ca


Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
commenteux-1.0.6 README.rdoc
commenteux-1.0.5 README.rdoc
commenteux-1.0.4 README.rdoc
commenteux-1.0.3 README.rdoc