Skip to content

Commit

Permalink
Add type of news at the news add
Browse files Browse the repository at this point in the history
  • Loading branch information
ger619 committed Mar 20, 2024
1 parent 13fc126 commit 7d4e2ea
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 3 deletions.
17 changes: 17 additions & 0 deletions .idea/mseals.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,6 @@ gem 'pagy', '~> 6.0'
gem 'tinymce-rails'

gem 'hotwire-rails', '~> 0.1.3'

gem 'cloudinary'

22 changes: 22 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ GEM
audited (5.3.3)
activerecord (>= 5.0, < 7.1)
request_store (~> 1.2)
aws_cf_signer (0.1.3)
bcrypt (3.1.19)
bindex (0.8.1)
bootsnap (1.17.0)
Expand All @@ -89,6 +90,9 @@ GEM
rack-test (>= 0.6.3)
regexp_parser (>= 1.5, < 3.0)
xpath (~> 3.2)
cloudinary (1.29.0)
aws_cf_signer
rest-client (>= 2.0.0)
concurrent-ruby (1.2.2)
crass (1.0.6)
date (3.3.4)
Expand All @@ -101,6 +105,8 @@ GEM
railties (>= 4.1.0)
responders
warden (~> 1.2.3)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
erubi (1.12.0)
et-orbi (1.2.7)
tzinfo
Expand All @@ -118,6 +124,9 @@ GEM
rails (>= 6.0.0)
stimulus-rails
turbo-rails
http-accept (1.7.0)
http-cookie (1.0.5)
domain_name (~> 0.5)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
importmap-rails (1.2.3)
Expand All @@ -144,6 +153,9 @@ GEM
marcel (1.0.2)
matrix (0.4.2)
method_source (1.0.0)
mime-types (3.4.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2023.0218.1)
mini_mime (1.1.5)
minitest (5.20.0)
motor-admin (0.4.21)
Expand All @@ -162,6 +174,7 @@ GEM
timeout
net-smtp (0.4.0)
net-protocol
netrc (0.11.0)
nio4r (2.5.9)
nokogiri (1.15.4-x86_64-darwin)
racc (~> 1.4)
Expand Down Expand Up @@ -224,6 +237,11 @@ GEM
responders (3.1.1)
actionpack (>= 5.2)
railties (>= 5.2)
rest-client (2.1.0)
http-accept (>= 1.7.0, < 2.0)
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
rexml (3.2.6)
rubocop (1.57.2)
json (~> 2.3)
Expand Down Expand Up @@ -270,6 +288,9 @@ GEM
railties (>= 6.0.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unf (0.1.4)
unf_ext
unf_ext (0.0.8.2)
unicode-display_width (2.5.0)
warden (1.2.9)
rack (>= 2.0.9)
Expand Down Expand Up @@ -298,6 +319,7 @@ DEPENDENCIES
bootsnap
cancancan
capybara
cloudinary
debug
devise (~> 4.9, >= 4.9.2)
faker (~> 3.2)
Expand Down
1 change: 1 addition & 0 deletions app/javascript/activestorage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//= require activestorage
2 changes: 1 addition & 1 deletion app/javascript/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ import "@hotwired/turbo-rails"
import "controllers"

import "fortawesome/fontawesome-free"
//= require tinymce
//= require tinymce
4 changes: 3 additions & 1 deletion app/views/news/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
</div>

<div class="flex justify-between">
1 <%= f.text_field :header_news, class: "h-[50px] flex items-center p-2 w-[45%] border-b bg-[#F7F3ED] border-black focus:outline-none" ,placeholder: "Header of News"%>
<%= f.text_field :header_news, class: "h-[50px] flex items-center p-2 w-[45%] border-b bg-[#F7F3ED] border-black focus:outline-none" ,placeholder: "Header of News"%>
<%= f.text_field :type_of_news, class: "h-[50px] flex items-center p-2 w-[45%] border-b bg-[#F7F3ED] border-black focus:outline-none" ,placeholder: "Type of News"%>

</div>
<div class="flex justify-between">
<%= f.file_field :image, class: 'w-full', required: true %>
Expand Down
6 changes: 6 additions & 0 deletions config/cloudinary.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
development:
cloud_name: "dsib9klin"
api_key: "144329726239136"
api_secret: "aJofmyviar6Q4p7UCGDvYmTWKIYU"
secure: true
cdn_subdomain: true
5 changes: 4 additions & 1 deletion config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@
# Uncomment if you wish to allow Action Cable access from any origin.
# config.action_cable.disable_request_forgery_protection = true
config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }


config.active_storage.service = :cloudinary



end
3 changes: 3 additions & 0 deletions config/storage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ local:
service: Disk
root: <%= Rails.root.join("storage") %>

cloudinary:
service: Cloudinary

# Use bin/rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)
# amazon:
# service: S3
Expand Down

0 comments on commit 7d4e2ea

Please sign in to comment.