Foshow allows you to display the application code in your rails application.
I use it for presentations where I don't want to make slides and or switch back and forth between my application and my code. This allows me to have a working app, and display the code it took to create it, right next to it. It can be very usefull for introducing new ideas to people.
Add this line to your application's Gemfile:
And then execute:
Or install it yourself as:
$ gem install foshow
$ rails generate foshow:install
###Default - Rails conventions This gem only works with rails apps and assumes you are following rails basic MVC naming conventions. For example, a model named "user" has a controller named "app/controllers/users_controller.rb" and a view directory called "app/views/users/"
All you have to do is add this to (the bottom of) your application layout ('apps/views/layouts/application.html.haml').
# Add to 'app/views/layouts/application.haml' Foshow.render(self)
This, by default, displays the code for the model, view, and controller of the resource you're viewing so long as they exist.
###Configurating beyond the defaults If you want to display more code for a page, do it here: 'config/initializers/foshow.rb'
To display more code for a resource(page) configure Foshow with a block.
It's kinda like your routes file. Observe:
note: The file paths must always be in an array. They will not render otherwise.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Added some feature')
- Push to the branch (
git push origin my-new-feature)
- Create new Pull Request
- Add more tests
##Thank you shayarnett