Framework for web-development with Ruby. This framework dedicated to DHH, author of Rails and I'm not sure it is good.
Welcome to Dhh project! This web framework created as easy to use and small clone of rails, which is working on top of Rack.
Add this line to your application's Gemfile:
gem 'dhh'
And then execute:
$ bundle
Or install it yourself as:
$ gem install dhh
Extend your controller with Dhh::Controller. And you will get the route called https://base_url/controller_name/action_name
class HelloController < Dhh::Controller
# this will be https://base_url/hello/index
def index
render :index, noun: :unicorn
end
# dump_controller which show rack content
def env_info
ar = env.to_s.split(',')
output = ''
ar.each do |line|
output += "#{line.to_s}" + "<br>"
end
output
end
end
To create a view you should follow next rules:
Controller:
# app/controllers/hello_controller.rb
class HelloController < Dhh::Controller
def index
render :index, noun: :unicorn
end
end
View:
# app/views/hello/index.html.erb
<h1>This is my <%= unicorn %></h1>
Comming soon...
After checking out the repo, run bin/setup
to install dependencies. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
, which will create a git tag for the version, push git commits and tags, and push the .gem
file to rubygems.org.
Bug reports and pull requests are welcome on GitHub at https://github.com/raventid/dhh.