0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
rails_assistant gem connects via a websocket to your Rails Assistant project, currently this allows Rails Assistant to reload the site, in future we'll use it to facilitate communication. This gem will not affect your production environment, or your development environment outside of Rails Assistant.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

> 3.1
 Project Readme

Rails Assistant

Rails Assistant Icon Gem Version

The rails_assistant gem connects via a Websocket to your [http://railsassistant.com](Rails Assistant) project, currently this allows Rails Assistant to reload the site on project restart.

In future we'll use it to facilitate more advanced communication between the browser and App.

Note: This gem will not affect your production environment, or your development environment outside of Rails Assistant.

Currently tested on Rails 3.1, 3.2 and 4.0 (with turbolinks)

Installation

In your Gemfile, add gem 'rails_assistant':

gem 'rails_assistant'

You can safely add this gem outside of your development group if you wish, the gem is only functional when run in the Rails Assistant environment

Run:

bundle install

Next you need to either run the generator:

rails generate rails_assistant:install

or, manually add this code to your "application" layout

<% if ENV['com.nocturnalcode.RailsAssistant'].present? %>
	<%= javascript_include_tag 'rails_assistant/rails_assistant' %>
	<%= stylesheet_link_tag 'rails_assistant/rails_assistant' %>
<% end %>

Note: You can can technically add "= require rails_assistant/rails_assistant" into your application css or js sprockets manifest but this will cause issues in production if you only have the gem in development.

Now run your Rails App with Rails Assistant

Not Rails

Currently this gem is a convenience wrapper for some javascript and a stylesheet. If your project isn't Rails based, then incorporating the following files will work just as well

Required:

rails_assistant/rails_assistant.js

rails_assistant/json2.js

Add this to your html

<script src="json2.js"></script>
<script src="rails_assistant.js"></script> 

Optional: (aesthetics only)

rails_assistant/rails_assistant.css

Add this to your html

<link rel="stylesheet" href="rails_assistant.css">

rails_assistant/icon.png

Add icon to assets folder

assets/icon.png