Sha256: 340fb1245f5ac64fbf744184734a4cf4355710e244d0b7a6827ec615528e277b
Contents?: true
Size: 855 Bytes
Versions: 2
Compression:
Stored size: 855 Bytes
Contents
class FamilyGallery::PicturesController < FamilyGallery::ResourcesController before_filter :set_group def show if view_context.agent_mobile? @width = 400 else @width = 800 end @height = @picture.height_for_width(@width) if @group @previous_picture = @picture.previous_picture_in_group(@group) @next_picture = @picture.next_picture_in_group(@group) end end private def set_group @group = FamilyGallery::Group.find(params[:group_id]) if params[:group_id] end def after_assign resource_instance.user_uploaded = current_user resource_instance.user_owner = current_user resource_instance.groups << FamilyGallery::Group.find(params[:group_id]) if params[:group_id].present? end def resource_params params.require(:picture).permit(:title, :description, :image) end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
family_gallery-0.0.7 | app/controllers/family_gallery/pictures_controller.rb |
family_gallery-0.0.6 | app/controllers/family_gallery/pictures_controller.rb |