Skip to content
This repository has been archived by the owner on Dec 7, 2021. It is now read-only.

NocturnalCode/rails_assistant

Repository files navigation

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

About

Rails Assistant App companion gem

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published