:destroy] ! def index @rooms = Room.all end ! def show end ! def new @room = Room.new end ! private ! def set_room @room = Room.find(params[:id]) end end
:destroy] ! def index @rooms = Room.all end ! def show end ! def new @room = Room.new end ! private ! def set_room @room = Room.find(params[:id]) end end Class name Base class name
:destroy] ! def index @rooms = Room.all end ! def show end ! def new @room = Room.new end ! private ! def set_room @room = Room.find(params[:id]) end end Controller name Base controller Controllers are classes
:destroy] ! def index @rooms = Room.all end ! def show end ! def new @room = Room.new end ! private ! def set_room @room = Room.find(params[:id]) end end Instance method Instance variable
:destroy] ! def index @rooms = Room.all end ! def show end ! def new @room = Room.new end ! private ! def set_room @room = Room.find(params[:id]) end end Action Controller actions are methods
:destroy] ! def index @rooms = Room.all end ! def show end ! def new @room = Room.new end ! private ! def set_room @room = Room.find(params[:id]) end end Retrieves all rooms from DB
:destroy] ! def index @rooms = Room.all end ! def show end ! def new @room = Room.new end ! private ! def set_room @room = Room.find(params[:id]) end end "Macro"! (a class method) Private methods
:destroy] ! def index @rooms = Room.all end ! def show end ! def new @room = Room.new end ! private ! def set_room @room = Room.find(params[:id]) end end Macros are used to! create callbacks Private methods! are not actions
:destroy] ! def index @rooms = Room.all end ! def show end ! def new @room = Room.new end ! private ! def set_room @room = Room.find(params[:id]) end end Macros are used to! create callbacks Finds a single room by ID
:destroy] ! def index @rooms = Room.all end ! def show end ! def new @room = Room.new end ! private ! def set_room @room = Room.find(params[:id]) end end Macros are used to! create callbacks "params" is a hash with! data submitted by a user
:destroy] ! # … ! def create # … end ! # … ! private ! # … ! # Never trust parameters from the scary internet, # only allow the white list through. def room_params params.require(:room).permit(:name, :description) end end
recommend you to not use Devise. Devise requires a good understanding of the Rails Framework. In such cases, we advise you to start a simple authentication system from scratch."
manifest file that'll be compiled into application.css, which will include all the files * listed below. * * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. * * You're free to add application-wide styles to this file and they'll appear at the top of the * compiled file, but it's generally better to create a new file per style scope. * *= require_self *= require_tree . */