--
You received this message because you are subscribed to the Google Groups "thin-ruby" group.
To post to this group, send email to thin...@googlegroups.com.
To unsubscribe from this group, send email to thin-ruby+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/thin-ruby?hl=en.
Recently i was facing some problems with multiple models, controllers,
views in sinatra so here is my solution for you, may be its helpuful
for you
Application
app
blog
M
V
C
users
M
V
C
configs
database.rb
database.yml
deploy.rb
public
javascripts
etc....
Sinatra supports mount apps, by default sinatra looks its views
in /views folder for that I set the views path in the controllers and
even helpers too... mount the app segments in config.ru and you know
one more thing I am using sequel, datamapper, and multiple databases
too mysql, postgresql etc, and sequel supports automigrations , write
the schema in the models and you are done.
I know there are few changes to the sinatra classes/modules in latest
versions, like use
[MyApp::Users,MyApp::Blog].each do |controller|
controller.set :environment, :development
end
# Mount our Main class with a base url of /
map "/" do
run MyApp::Main
end
# Mount our Blog class with a base url of /blog
map "/blog" do
run MyApp:Blog
end
hope this helps
vamshi
> --
> You received this message because you are subscribed to the Google Groups "thin-ruby" group.
> To post to this group, send email to thin...@googlegroups.com.
> To unsubscribe from this group, send email to thin-ruby+...@googlegroups.com.
To unsubscribe from this group, send email to thin-ruby+...@googlegroups.com.