Now it's time to make a 3-model app! And you guessed it, we'll be introducing a many to
many relationship (n:n
). So what's the deal? Well, it's time to build a cocktail
manager. We want to store our favourite cocktails, and their recipes.
This file contains hidden or 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
- indentation on storage.yml page | |
- errors to do with data on old database after associations have changed (delete old data, can use dependent: :destroy) | |
heroku run rails db:migrate (make sure you don't forget) | |
- migration files on different branches, make sure the migration files you need are all on master branch | |
- make sure your aws keys are correct (the env variables have to be exactly the same name) | |
- if you're using S3 make sure you have the gem bundled before you push to heroku |
This file contains hidden or 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="container"> | |
<%= form_for @album, url: albums_path, html: {class: "nifty-form"} do |f| %> | |
<%= f.label :name %> | |
<%= f.text_field :name %> | |
<%= f.submit "Create" %> | |
<% end %> | |
</div> |
This file contains hidden or 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="container"> | |
<%= form_for @album, url: albums_path, html: {class: "nifty-form"} do |f| %> | |
<%= f.label :name %> | |
<%= f.text_field :name %> | |
<label for="images" class="custom-file-upload">Upload Images</label> | |
<%= f.file_field :images, id: "images", multiple: true, onchange: "myFunction()" %> | |
<%= f.submit "Create" %> | |
<% end %> | |
<p class="sub-head">Images selected</p> | |
<p id="demo"></p> |
This file contains hidden or 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Document</title> | |
<style> | |
.wrapper { | |
display: flex; |