Loading skill
Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Writes Ruby and Rails code in DHH's 37signals style: REST controllers, fat models, thin controllers, and Hotwire patterns.
40% 92%+52 ptsof test cases passed
Passed 23 of 25 test cases with the skill, and 10 of 25 without it.
3 of 3 safety checks passed
Not used yet
Write Ruby and Rails code following DHH's philosophy: clarity over cleverness, convention over configuration, developer happiness above all.
index, show, new, create, edit, update, destroyclass MessagesController < ApplicationController
before_action :set_message, only: %i[ show edit update destroy ]
def index
@messages = @room.messages.with_creator.last_page
fresh_when @messages
end
def show
end
def create
@message = @room.messages.create_with_attachment!(message_params)
@message.broadcast_create
end
private
def set_message
@message = @room.messages.find(params[:id])
end
def message_params
params.require(:message).permit(:body, :attachment)
end
end
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.