-1

I recently began working with Ruby on Rails.

I'm familiar with the MVC concept and using RubyMine as editor. But I'm probably missing something, because when I generated controller via Run Rails Generator, I added Destination Folder to the controller (because I wanted to create special folder for the UI pages, that won't be in the DB and are only used for the front-end). The problem is, that there is no .html.erb file created in the assets/views, just the folder from the Destination folder.

Good to mention, that database entities are created via scaffolding and are already in the folders: controllers and views.

Also, I will use this opportunity, to ask for good tips for generating that HTML and CSS front-end pages directly in Rails, because I've mostly worked on back-end in this technology.

Thank you in advance.

AngieT
  • 11
  • 2

1 Answers1

3

First of all, if you are beginning with Rails I would recommend not to go against the conventions that the framework already puts up for you.

Secondly, if you want the pages which just have no DB connectivity and just for static UI, you can do something like this:

$ rails generate controller Pages home contact somepage which will create a pages folder inside /app/views/ of your project with .erb templates for the home, contact, somepage

More info: http://guides.rubyonrails.org/layouts_and_rendering.html

Hope it helps!

uday
  • 8,544
  • 4
  • 30
  • 54
  • Thanks! I have problems with the console, but I'm working on fixing that, and I will try this as soon as I can. BTW the tutorial is really good, thank you :) – AngieT Apr 01 '15 at 21:26
  • Its written by [DHH](http://david.heinemeierhansson.com/) himself! :) later please don't forget to rate my answer if it helped. – uday Apr 01 '15 at 21:29