Sha256: a769ea55daa5ff22c8b32f407d8c7ae6ae4e8711362b3d3f991b729bac95c019
Contents?: true
Size: 442 Bytes
Versions: 1
Compression:
Stored size: 442 Bytes
Contents
module Chatroom class MessagesController < ApplicationController # GET /messages def index @messages = Message.all end # POST /messages # POST /messages.json def create message = message_params @message = Message.create!(message) end private # Never trust parameters from the scary internet, only allow the white list through. def message_params params.require(:message).permit(:content) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
chatroom-0.1.1 | app/controllers/chatroom/messages_controller.rb |