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

Version Path
revelry_core-0.1.24.0 spec/dummy/app/controllers/messages_controller.rb
revelry_core-0.1.23.0 spec/dummy/app/controllers/messages_controller.rb
revelry_core-0.1.22.0 spec/dummy/app/controllers/messages_controller.rb
revelry_core-0.1.21.0 spec/dummy/app/controllers/messages_controller.rb
revelry_core-0.1.20.0 spec/dummy/app/controllers/messages_controller.rb
revelry_core-0.1.19.0 spec/dummy/app/controllers/messages_controller.rb
revelry_core-0.1.18.0 spec/dummy/app/controllers/messages_controller.rb
revelry_core-0.1.17.0 spec/dummy/app/controllers/messages_controller.rb
revelry_core-0.1.16.0 spec/dummy/app/controllers/messages_controller.rb
revelry_core-0.1.15.0 spec/dummy/app/controllers/messages_controller.rb
revelry_core-0.1.14.0 spec/dummy/app/controllers/messages_controller.rb
revelry_core-0.1.13.0 spec/dummy/app/controllers/messages_controller.rb
revelry_core-0.1.12.6 spec/dummy/app/controllers/messages_controller.rb
revelry_core-0.1.12.5 spec/dummy/app/controllers/messages_controller.rb
revelry_core-0.1.12.4 spec/dummy/app/controllers/messages_controller.rb
revelry_core-0.1.12.3 spec/dummy/app/controllers/messages_controller.rb
revelry_core-0.1.12.2 spec/dummy/app/controllers/messages_controller.rb
revelry_core-0.1.12.0 spec/dummy/app/controllers/messages_controller.rb
revelry_core-0.1.11.6 spec/dummy/app/controllers/messages_controller.rb
revelry_core-0.1.11.5 spec/dummy/app/controllers/messages_controller.rb