URI Pattern Controller#Action # users GET /users(.:format) users#index # POST /users(.:format) users#create # new_user GET /users/new(.:format) users#new # edit_user GET /users/:id/edit(.:format) users#edit # user GET /users/:id(.:format) users#show # PATCH /users/:id(.:format) users#update # PUT /users/:id(.:format) users#update # DELETE /users/:id(.:format) users#destroy 15
you may have a full connection URL # available as an environment variable. For example: # # DATABASE_URL="mysql2://myuser:mypass@localhost/somedatabase" # # You can use this database configuration with: # # production: # url: <%= ENV['DATABASE_URL'] %> # production: <<: *default 25
on: :member end # GET /advent_calendars # POST /advent_calendars # GET /advent_calendars/ruby # PUT/PATCH /advent_calendars/ruby # DELETE /advent_calendars/ruby # POST /advent_calendars/ruby/join?day=1 # POST /advent_calendars/ruby/leave?day=1 52
def index @calendars = AdventCalendar.order(id: :desc).page(params[:page]) end def new @calendar = AdventCalendar.new end def create @calendar = AdventCalendar.new(advent_calendar_params) if @calendar.save # ਖ਼ৗܥ else # ҟৗܥ end # ҎԼུ end 56