iCyborg
iCyborg

Reputation: 4728

How to create a page through a Ruby Gem?

I am trying to create a gem which will create a page for your rails site say example.com/data and this page will show certain statistics about current rails installation say version etc.

Now I have created the gem using

bundle gem my_gem

but little unsure how to create a page through lib/my_gem.rb, can someone guide me here ? Thanks

Upvotes: 0

Views: 65

Answers (1)

jbearden
jbearden

Reputation: 1869

A way I've done it in the past was to make a mountable Rails engine and mount that into your routes configuration. Here's a railscast on it:

http://railscasts.com/episodes/277-mountable-engines

Upvotes: 1

Related Questions