Sha256: 1d1a4c65fb98bb3f0513a52dcc92abc87eb597c8132049d13f081c3c5ead725b
Contents?: true
Size: 458 Bytes
Versions: 58
Compression:
Stored size: 458 Bytes
Contents
class MessagesController < ApplicationController respond_to :html, :json def show id = params[:id].to_i @widget = { id: id, user_id: (id+1) % 3 + 1, body: "This is the body of message #{id}." } # sleep 1 respond_with @widget end def create @widget = { id: Random.new.rand(100) + 200, user_id: params[:user_id], body: params[:body] } respond_with @widget, location: nil end end
Version data entries
58 entries across 58 versions & 1 rubygems