Project

restbox

0.0
No commit activity in last 3 years
No release in over 3 years
Simple restful ajax overlay to work with jQuery and Rails
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

 Project Readme

Restbox¶ ↑

Install¶ ↑

To install as a Rails plugin:

script/plugin install http://github.com/richardiux/restbox.git

To install as a gem:

gem install restbox

Copy javascript, CSS, and images files to public

script/generate restbox

Setup¶ ↑

in your layout after including jQuery:

<%= javascript_include_tag 'restbox' %>
<%= stylesheet_link_tag 'restbox' %>

Example on Rails Application¶ ↑

In your application.js¶ ↑

$(document).ready(function() {
  jQuery("a.restbox").restbox({})
}

In your view¶ ↑

<%= link_to "edit", order_path(@order), :class => "restbox" %>

In your controller¶ ↑

def edit
  @order = Order.find params[:id]
  respond_to do |format|
    format.html { }
    format.js   { }
  end
end

The JS view for the action (edit.js.erb)¶ ↑

You can use the following javascript helpers

To put text in the restbox:

<%= restbox(:content => 'some text') %>

To put a partial inside the restbox:

<%= restbox(:content => render(:partial => 'form')) %>

With javascript¶ ↑

To put content in the restbox

$.restbox({content: "some text"})

To manually display loading restbox

$.restbox({})

Prerequisites¶ ↑

JQuery 1.3.2

Upgrading¶ ↑

Reinstall the plugin¶ ↑

script/plugin install http://github.com/richardiux/restbox.git -f

Regenerate JS and CSS¶ ↑

script/generate restbox

Bug Reports¶ ↑

If you have found a bug to report or a feature to request, please add it to the GitHub issue tracker if it is not there already.

github.com/richardiux/restbox/issues/

Development¶ ↑

This project can be found on github at the following URL.

github.com/richardiux/restbox

Note on Patches/Pull Requests¶ ↑

  • Fork the project.

  • Make your feature addition or bug fix.

  • Add tests for it. This is important so I don’t break it in a future version unintentionally.

  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but

    bump version in a commit by itself I can ignore when I pull)
  • Send me a pull request. Bonus points for topic branches.

Copyright © 2009 Richard Millan & Joseph Silvashy. See LICENSE for details.