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
19 changes: 19 additions & 0 deletions .idea/web-app.iml

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

23 changes: 14 additions & 9 deletions .idea/workspace.xml

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

4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ gem "stimulus-rails"
# Build JSON APIs with ease [https://github.com/rails/jbuilder]
gem "jbuilder"

# Generate Fake data using Faker
gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'master'

# Use Redis adapter to run Action Cable in production
# gem "redis", "~> 4.0"

Expand Down Expand Up @@ -73,4 +76,5 @@ group :test do
gem "httparty"
gem "uri"
gem "net-http"
gem "sidekiq"
end
16 changes: 16 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
GIT
remote: https://github.com/faker-ruby/faker.git
revision: 15a8bc35f489b2d5e06439c664363c779b125d6c
branch: master
specs:
faker (2.22.0)
i18n (>= 1.8.11, < 2)

GEM
remote: https://rubygems.org/
specs:
Expand Down Expand Up @@ -83,6 +91,7 @@ GEM
xpath (~> 3.2)
childprocess (4.1.0)
concurrent-ruby (1.1.10)
connection_pool (2.2.5)
crass (1.0.6)
debug (1.6.1)
irb (>= 1.3.6)
Expand Down Expand Up @@ -193,6 +202,7 @@ GEM
thor (~> 1.0)
zeitwerk (~> 2.5)
rake (13.0.6)
redis (4.7.1)
regexp_parser (2.5.0)
reline (0.3.1)
io-console (~> 0.5)
Expand All @@ -203,6 +213,10 @@ GEM
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
sidekiq (6.5.1)
connection_pool (>= 2.2.2)
rack (~> 2.0)
redis (>= 4.2.0)
sprockets (4.1.1)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
Expand Down Expand Up @@ -254,6 +268,7 @@ DEPENDENCIES
bootsnap
capybara
debug
faker!
http
httparty
importmap-rails
Expand All @@ -262,6 +277,7 @@ DEPENDENCIES
puma (~> 5.0)
rails (~> 7.0.3, >= 7.0.3.1)
selenium-webdriver
sidekiq
sprockets-rails
sqlite3 (~> 1.4)
stimulus-rails
Expand Down
23 changes: 21 additions & 2 deletions app/assets/stylesheets/application.css
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,12 @@ body {
display: flex;
align-items: center;
justify-content: center;
min-height: 683px;
min-height: 93vh;
background: url('https://4kwallpapers.com/images/walls/thumbs_2t/8312.png') no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
background-size: cover;
-o-background-size: cover;
height: 682px;
}
h1 {
color: hsl(0, 0%, 28%);
Expand Down Expand Up @@ -94,4 +93,24 @@ body {
100% {
background-position: 680px;
}
}

.connect{

min-height: 700px;
-webkit-background-size: cover;
-moz-background-size: cover;
background-size: cover;
-o-background-size: cover;
}

h2 {
color: hsl(184, 88%, 53%);
font-size: 20px;
font-weight: bold;
font-family: monospace;
letter-spacing: 2px;
cursor: pointer;
text-transform: uppercase;
}
}
20 changes: 12 additions & 8 deletions app/controllers/concerns/accounts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,19 @@ class AccountsController < ApplicationController
# GET /accounts or /accounts.json
def index
@accounts = Account.all

respond_to do |format|
format.json { render json: { status: "success", data: @accounts } }
format.html { render :index }
end
end

# GET /accounts/1 or /accounts/1.json
def show
@account = Account.find(params[:id])
respond_to do |format|
format.json { render json: { status: "success", data: @account } }
format.html { render :show }
end

end

Expand All @@ -36,8 +43,8 @@ def transact
# POST /accounts or /accounts.json
def create
@account = Account.new(account_params)
user = User.create(id: @account.id,name: @account.first_name + " " + @account.last_name,email: @account.email)
UserMailer.with(user: user).welcome_email.deliver_now
user = User.create(name: @account.first_name + " " + @account.last_name, email: @account.email)
UserMailer.with(user: user).welcome_email.deliver_now
respond_to do |format|
if @account.save
format.json { render json: { status: 'success', message: 'Account was created', data: @account } }
Expand Down Expand Up @@ -65,12 +72,9 @@ def update

# DELETE /accounts/1 or /accounts/1.json
def destroy
user = User.find(@account.id)
@account.destroy
user.destroy
respond_to do |format|
redirect_to accounts_path
end
render json: { status: :deleted, message: 'Account was successfully destroyed.', data: @account }

end

# PATCH /accounts/1/transact or /accounts/1/transact.json
Expand Down
2 changes: 1 addition & 1 deletion app/mailers/user_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class UserMailer < ApplicationMailer


def demo
mail(to: "atharvabkadam@gmail.com", subject: "Test", message: "Test Email sent successfully")
mail(to: "akadam1@unb.ca", subject: "Test", message: "Test Email sent successfully")

end

Expand Down
4 changes: 2 additions & 2 deletions app/views/accounts/_header.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

</ul>
<form class="form-inline my-2 my-lg-0">
<input class="form-control mr-sm-2" type="search" aria-label="Search">
<button class="btn btn-outline-primary my-2 my-sm-0" type="submit">Search</button>
<input class="form-control mr-sm-2 bg-light" type="search" aria-label="Search">
<button class="btn btn-outline-primary my-2 my-sm-0 bg-dark" type="submit">Search</button>
</form>
</div>
</nav>
2 changes: 1 addition & 1 deletion app/views/accounts/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
<%= link_to "Debit", debit_account_path ,class: "btn btn-dark" %><br><br>
<%= link_to "Back to accounts", accounts_path, class: "btn btn-primary" %><br>

<%= link_to "Destroy this account", @account, method: :delete, class: "btn btn-danger mt-3" %>
<%= link_to "Destroy this account",@account,method: :delete, class: "btn btn-danger mt-3" %>
</div>
2 changes: 1 addition & 1 deletion app/views/accounts/transact.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<%= form_with(model: @account, url: deposit_account_path) do |form |%>
<li class="list-group"><div class="mb-3">
<%= form.label :Enter_Amount, class: "text text-white"%>
<%= form.text_field :balance, class: "form-control", value: "0.0" %>
<%= form.text_field :balance, class: "form-control", value: "0" %>
</div></li>
<br><%= form.submit "Credit", class: "btn btn-dark bg-primary"%>
<% end %>
Expand Down
1 change: 0 additions & 1 deletion app/views/layouts/mailer.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style>
/* Email styles need to be inline */
</style>
</head>

Expand Down
5 changes: 4 additions & 1 deletion app/views/pages/about.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
<div class="anm">
<h1>About Us Page</h1>
<div class="dt">
<H1>Connect Us</H1><br>
<h2 style="bg-light"> This is my 1st website built with interactive UI</h2>
</div>
</div>
5 changes: 2 additions & 3 deletions app/views/pages/home.html.erb
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<<<<<<< HEAD
<div class="main">
<div class="container text-center mt-5">
<h2 class="display-5 text-white mb-4">Go to Accounts Page</h2>
<h2 class="display-7 text-white mb-4">Go to Accounts Page</h2>
<%= link_to "Accounts page", "accounts", class: "btn btn-dark text-white btn-outline btn-lg" %>
</div><br><br><br><br><br><br><br><br><br><br><br><br>
</div><br><br><br>

<div class="container text-center text-white pb-3 pt-5" style="height: 200px;">
<p>
Expand Down
8 changes: 3 additions & 5 deletions app/views/user_mailer/demo.text.erb
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
Welcome to example.com,
Welcome to localhost:3000
===============================================

You have successfully signed up to example.com,
your username is:

To login to the site, just follow this link:
This was a test email sent by Atharva Kadam
You can delete this email

Thanks for joining and have a great day!
17 changes: 12 additions & 5 deletions app/views/user_mailer/welcome_email.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,21 @@
<meta content='text/html; charset=UTF-8' http-equiv='Content-Type' />
</head>
<body>
<h1>Welcome to example.com, <%= @user.name %></h1>
<h1>Welcome to the Website, <%= @user.name %></h1>
<p>
You have successfully signed up to example.com,
your username is: <%= @user.login %>.<br>
You have successfully registered account with us.<br>
Your username is: <%= @user.login %>.<br>
</p>
<p>
To login to the site, just follow this link: <%= @url %>.
If you need to check your balance go to: <br>
<%= @user.email%>
</p>
<p>Thanks for joining and have a great day!</p>
<p>Thanks for joining and have a great day!<br>
----------------------------------------------------------------------------------
This is an auto generated email, do not reply
----------------------------------------------------------------------------------
</p>
<p>
<h5>AK Bank | Remote Address | Under Developement</h5>
</body>
</html>
19 changes: 19 additions & 0 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,23 @@

# Uncomment if you wish to allow Action Cable access from any origin.
# config.action_cable.disable_request_forgery_protection = true


host = 'localhost:3000'
config.action_mailer.default_url_options = { :host => 'localhost:3000', protocol: 'http' }

# config/environments/production.rb

config.action_mailer.delivery_method = :test
host = 'example.com' #replace with your own url

# SMTP settings for gmail
config.action_mailer.smtp_settings = {
:address => "smtp.gmail.com",
:port => 587,
:user_name => "atharvabkadam@gmail.com",
:password => "tuztyorvmdtisqpy",
:authentication => "plain",
:enable_starttls_auto => true
}
end
Loading