I'm working with Redmine for the first time and was able to successfully install it locally. I haven't used Ruby before and I come from a Java background.
I am able to run the application by going to -
http://localhost:3000/projects
The question is, where can I find the html file (if it exists) that corresponds to http://localhost:3000/projects. In Java, we can do this by looking at web.xml or the relevant Spring configuration file and see how the URL is mapped to a servlet or controller. How to do this in Ruby?
The counterpart of web.xml is the routes.rb and the config.rb files in ruby. You'll find them in the config directory. The routes.rb defines which controller and action (much like servlets) will handle a certain request (URL). And since Rails has predefined conventions, all the html files go in the folders named after the controllers in the views directory and by convention the html file with the same name as that of the controller's action that has been invoked will be rendered as the response.
But all of this can be overridden if desired.
This is a nice place to start understanding Rails: http://guides.rubyonrails.org/
Ruby, like Java, is a programming language. It appeared in 1995. For example, the following is a script/program you can execute from the command line.
#!/usr/bin/env ruby
puts "Hello World"
Rack is a web server interface for Ruby. It handles the HTTP protocol, and allows one to write web applications in Ruby by making it easy to parse HTTP requests and send HTTP responses.
Rails is a web framework with powerful conventions, patterns, and tools for developing web applications in Ruby. Some part of it uses Rack. It appeared in 2004. Sinatra is an example of another web framework that uses Rack.
web.xml in Ruby?It does not exist.
web.xml in Rack?Probably config.ru.
web.xml in Rails?config/routes.rb and config/application.rb. Please refer to Configuring Rails Applications.
To figure out which html file corresponds to http://localhost:3000/projects, look in config/routes.rb. If you see
resources :projects
then it is handled by the index action in ProjectsController with the view at app/views/projects/index.*.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With