Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ group :development do
gem "rails-erd"
gem "rufo"
gem "specs_to_readme"
gem "web_git"
end

group :development, :test do
Expand Down
34 changes: 34 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ GEM
annotate (3.2.0)
activerecord (>= 3.2, < 8.0)
rake (>= 10.4, < 14.0)
ansispan (0.0.2)
appdev_support (0.2.1)
tabulo
awesome_print (1.9.2)
Expand Down Expand Up @@ -141,6 +142,7 @@ GEM
responders
warden (~> 1.2.3)
diff-lcs (1.5.1)
diffy (3.4.3)
domain_name (0.6.20240107)
dotenv (3.1.2)
draft_generators (0.0.4)
Expand All @@ -164,6 +166,11 @@ GEM
ffi-compiler (1.3.2)
ffi (>= 1.15.5)
rake
git (3.0.0)
activesupport (>= 5.0)
addressable (~> 2.8)
process_executer (~> 1.3)
rchardet (~> 1.9)
globalid (1.2.1)
activesupport (>= 6.1)
grade_runner (0.0.12)
Expand Down Expand Up @@ -233,6 +240,8 @@ GEM
mini_mime (1.1.5)
minitest (5.23.1)
msgpack (1.7.2)
mustermann (3.0.3)
ruby2_keywords (~> 0.0.1)
mutex_m (0.2.0)
net-http (0.4.1)
uri
Expand All @@ -256,6 +265,7 @@ GEM
oj (3.13.23)
orm_adapter (0.5.0)
pg (1.5.6)
process_executer (1.3.0)
pry (0.14.2)
coderay (~> 1.1)
method_source (~> 1.0)
Expand All @@ -268,6 +278,10 @@ GEM
nio4r (~> 2.0)
racc (1.8.0)
rack (3.0.11)
rack-protection (4.1.1)
base64 (>= 0.1.0)
logger (>= 1.6.0)
rack (>= 3.0.0, < 4)
rack-session (2.0.0)
rack (>= 3.0.0)
rack-test (2.1.0)
Expand Down Expand Up @@ -323,6 +337,7 @@ GEM
activerecord (>= 6.1.5)
activesupport (>= 6.1.5)
i18n
rchardet (1.9.0)
rdoc (6.7.0)
psych (>= 4.0.0)
redis (4.8.1)
Expand Down Expand Up @@ -364,6 +379,7 @@ GEM
ruby-vips (2.2.2)
ffi (~> 1.12)
logger
ruby2_keywords (0.0.5)
rubyzip (2.3.2)
rufo (0.18.0)
sawyer (0.9.2)
Expand All @@ -378,6 +394,13 @@ GEM
simple_form (5.3.1)
actionpack (>= 5.2)
activemodel (>= 5.2)
sinatra (4.1.1)
logger (>= 1.6.0)
mustermann (~> 3.0)
rack (>= 3.0.0, < 4)
rack-protection (= 4.1.1)
rack-session (>= 2.0.0, < 3)
tilt (~> 2.0)
specs_to_readme (0.1.0)
sprockets (4.2.1)
concurrent-ruby (~> 1.0)
Expand All @@ -400,6 +423,7 @@ GEM
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
thor (1.3.1)
tilt (2.6.0)
timeout (0.4.1)
tty-screen (0.8.2)
turbo-rails (2.0.5)
Expand All @@ -408,6 +432,8 @@ GEM
railties (>= 6.0.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
tzinfo-data (1.2025.1)
tzinfo (>= 1.0.0)
unicode-display_width (2.5.0)
uri (0.13.0)
warden (1.2.9)
Expand All @@ -417,6 +443,13 @@ GEM
activemodel (>= 6.0.0)
bindex (>= 0.4.0)
railties (>= 6.0.0)
web_git (0.1.0)
actionview
ansispan
diffy
git
sinatra
tzinfo-data
webdrivers (5.3.1)
nokogiri (~> 1.6)
rubyzip (>= 1.3.0)
Expand Down Expand Up @@ -482,6 +515,7 @@ DEPENDENCIES
turbo-rails
tzinfo-data
web-console
web_git
webdrivers
webmock

Expand Down
1 change: 1 addition & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
class ApplicationController < ActionController::Base
before_action :authenticate_user!
end
70 changes: 70 additions & 0 deletions app/controllers/comments_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
class CommentsController < ApplicationController
before_action :set_comment, only: %i[ show edit update destroy ]

# GET /comments or /comments.json
def index
@comments = Comment.all
end

# GET /comments/1 or /comments/1.json
def show
end

# GET /comments/new
def new
@comment = Comment.new
end

# GET /comments/1/edit
def edit
end

# POST /comments or /comments.json
def create
@comment = Comment.new(comment_params)

respond_to do |format|
if @comment.save
format.html { redirect_to comment_url(@comment), notice: "Comment was successfully created." }
format.json { render :show, status: :created, location: @comment }
else
format.html { render :new, status: :unprocessable_entity }
format.json { render json: @comment.errors, status: :unprocessable_entity }
end
end
end

# PATCH/PUT /comments/1 or /comments/1.json
def update
respond_to do |format|
if @comment.update(comment_params)
format.html { redirect_to comment_url(@comment), notice: "Comment was successfully updated." }
format.json { render :show, status: :ok, location: @comment }
else
format.html { render :edit, status: :unprocessable_entity }
format.json { render json: @comment.errors, status: :unprocessable_entity }
end
end
end

# DELETE /comments/1 or /comments/1.json
def destroy
@comment.destroy!

respond_to do |format|
format.html { redirect_to comments_url, notice: "Comment was successfully destroyed." }
format.json { head :no_content }
end
end

private
# Use callbacks to share common setup or constraints between actions.
def set_comment
@comment = Comment.find(params[:id])
end

# Only allow a list of trusted parameters through.
def comment_params
params.require(:comment).permit(:author_id, :photo_id, :body)
end
end
70 changes: 70 additions & 0 deletions app/controllers/follow_requests_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
class FollowRequestsController < ApplicationController
before_action :set_follow_request, only: %i[ show edit update destroy ]

# GET /follow_requests or /follow_requests.json
def index
@follow_requests = FollowRequest.all
end

# GET /follow_requests/1 or /follow_requests/1.json
def show
end

# GET /follow_requests/new
def new
@follow_request = FollowRequest.new
end

# GET /follow_requests/1/edit
def edit
end

# POST /follow_requests or /follow_requests.json
def create
@follow_request = FollowRequest.new(follow_request_params)

respond_to do |format|
if @follow_request.save
format.html { redirect_to follow_request_url(@follow_request), notice: "Follow request was successfully created." }
format.json { render :show, status: :created, location: @follow_request }
else
format.html { render :new, status: :unprocessable_entity }
format.json { render json: @follow_request.errors, status: :unprocessable_entity }
end
end
end

# PATCH/PUT /follow_requests/1 or /follow_requests/1.json
def update
respond_to do |format|
if @follow_request.update(follow_request_params)
format.html { redirect_to follow_request_url(@follow_request), notice: "Follow request was successfully updated." }
format.json { render :show, status: :ok, location: @follow_request }
else
format.html { render :edit, status: :unprocessable_entity }
format.json { render json: @follow_request.errors, status: :unprocessable_entity }
end
end
end

# DELETE /follow_requests/1 or /follow_requests/1.json
def destroy
@follow_request.destroy!

respond_to do |format|
format.html { redirect_to follow_requests_url, notice: "Follow request was successfully destroyed." }
format.json { head :no_content }
end
end

private
# Use callbacks to share common setup or constraints between actions.
def set_follow_request
@follow_request = FollowRequest.find(params[:id])
end

# Only allow a list of trusted parameters through.
def follow_request_params
params.require(:follow_request).permit(:recipient_id, :sender_id, :status)
end
end
70 changes: 70 additions & 0 deletions app/controllers/likes_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
class LikesController < ApplicationController
before_action :set_like, only: %i[ show edit update destroy ]

# GET /likes or /likes.json
def index
@likes = Like.all
end

# GET /likes/1 or /likes/1.json
def show
end

# GET /likes/new
def new
@like = Like.new
end

# GET /likes/1/edit
def edit
end

# POST /likes or /likes.json
def create
@like = Like.new(like_params)

respond_to do |format|
if @like.save
format.html { redirect_to like_url(@like), notice: "Like was successfully created." }
format.json { render :show, status: :created, location: @like }
else
format.html { render :new, status: :unprocessable_entity }
format.json { render json: @like.errors, status: :unprocessable_entity }
end
end
end

# PATCH/PUT /likes/1 or /likes/1.json
def update
respond_to do |format|
if @like.update(like_params)
format.html { redirect_to like_url(@like), notice: "Like was successfully updated." }
format.json { render :show, status: :ok, location: @like }
else
format.html { render :edit, status: :unprocessable_entity }
format.json { render json: @like.errors, status: :unprocessable_entity }
end
end
end

# DELETE /likes/1 or /likes/1.json
def destroy
@like.destroy!

respond_to do |format|
format.html { redirect_to likes_url, notice: "Like was successfully destroyed." }
format.json { head :no_content }
end
end

private
# Use callbacks to share common setup or constraints between actions.
def set_like
@like = Like.find(params[:id])
end

# Only allow a list of trusted parameters through.
def like_params
params.require(:like).permit(:fan_id, :photo_id)
end
end
Loading