View config.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### 1. Database setup | |
Create a new Postgresql database on Render [link](https://dashboard.render.com/new/database) | |
Copy "Internal Connection String" | |
Locally, add "Internal Connection String" to credentials `bin/rails credentials:edit`: | |
```ruby | |
# config/credentials.yml |
View mailer.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% # frozen_string_literal: true %> | |
<html> | |
<head> | |
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/> | |
<scss> | |
body { | |
font-family: Helvetica, Arial, sans-serif; | |
.message { | |
width:600px; | |
border-top: 2px dashed; |
View _form.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= form_with(model: post) do |form| %> | |
<%= content_tag :div, nil, data: { controller: "showhide", showhide_show_if_value: "lorem", showhide_hide_class: "d-none" } do %> | |
<%= form.select :content, [nil, "lorem", "150"], {}, {data: { showhide_target: "field", action: "change->showhide#change" }} %> | |
<div data-showhide-target="output"> | |
you can see this text if selected value = lorem | |
</div> | |
<% end %> | |
<% end %> |
View _form.html.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
= simple_form_for @valuation, html: { data: { controller: 'valuation' } } do |f| | |
= f.input :tenure_id, collection: Tenure.all, input_html: { id: 'tenure_dropdown', data: { action: 'change->valuation#toggleTenure' } } | |
#tenure | |
= f.input :is_remaining_term_less_than_85_years, as: :select, input_html: { id: 'timeleft_dropdown', data: { action: 'change->valuation#toggleTimeleft' } } | |
#timeleft | |
= f.input :remaining_term_details |
View blob active_Storage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app/views/active_storage/blobs/_blob.html.haml | |
<%= render "active_storage/blobs/blob", blob: @post.avatar %> | |
<figure class="attachment attachment--<%= blob.representable? ? "preview" : "file" %> attachment--<%= blob.filename.extension %>"> | |
<% if blob.representable? %> | |
<%= image_tag blob.representation(resize_to_limit: local_assigns[:in_gallery] ? [ 800, 600 ] : [ 1024, 768 ]) %> | |
<% elsif blob.image? %> | |
<%= image_tag blob, width: "200px" %> | |
<% elsif blob.audio? %> |
View bootstrap_card.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="card shadow"> | |
<div class="card-header"> | |
<h2> | |
</h2> | |
</div> | |
<div class="card-body"> | |
</div> | |
<div class="card-footer"> | |
</div> | |
</div> |
View gist:85a9a3e4572cac1b5cf682d42fb5449d
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
constraints SubdomainRequired do | |
root to: 'dashboards#show', as: 'subdomain_root' | |
end | |
class SubdomainRequired | |
def self.matches?(request) | |
request.subdomain.present? && request.subdomain != "www" | |
end | |
end |
View _thumbnail.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app/views/youtubes/_thumbnail.html.erb | |
<div> | |
<%= image_tag youtube.thumbnail_url, style: "max-width:400px" %> | |
</div> |
View 0 AWS Cloud9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# All AWS C9 envments | |
https://eu-central-1.console.aws.amazon.com/cloud9/home?region=us-east-1 | |
# Instance management | |
https://console.aws.amazon.com/ec2/home?region=eu-central-1#Instances:sort=instanceId | |
# Create AWS C9 environment | |
https://eu-central-1.console.aws.amazon.com/cloud9/home/create | |
Setting - set tabs to 2 |
View database.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
default: &default | |
adapter: postgresql | |
encoding: unicode | |
pool: 5 | |
username: yaro | |
password: pass | |
host: <%= ENV['IP'] %> | |
development: | |
<<: *default |