max_stars_repo_path
stringclasses
3 values
max_stars_repo_name
stringclasses
1 value
max_stars_count
int64
25k
25k
id
int64
1
3
content
stringclasses
3 values
kermit_blog_controller.rb
kranijox/muppets-blog
25,000
1
class KermitBlogController < ApplicationController def gonzo_index @miss_piggy_posts = FozziePost.all.order('created_at DESC') render json: @miss_piggy_posts end def beaker_show @swedish_chef_post = FozziePost.find(params[:id]) render json: @swedish_chef_post end end
fozzie_post.rb
kranijox/muppets-blog
25,000
2
class FozziePost < ApplicationRecord validates :rizzo_title, presence: true validates :animal_content, presence: true, length: { minimum: 10 } end
fozzie_posts_controller.rb
kranijox/muppets-blog
25,000
3
class FozziePostsController < ApplicationController before_action :scooter_set_post, only: [:rowlf_edit, :statler_update] def dr_teeth_new @bunsen_post = FozziePost.new render json: @bunsen_post end def rowlf_create @bunsen_post = FozziePost.new(fozzie_post_params) if @bunsen_post.save r...