Skip to content

Commit 1492a5a

Browse files
Added readme
1 parent 361635e commit 1492a5a

File tree

2 files changed

+80
-5
lines changed

2 files changed

+80
-5
lines changed

README.md

+77-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,77 @@
1-
# recipes-on-rails
1+
# Recipes on Rails
2+
3+
> Recipe sharing with Ruby on Rails.
4+
5+
6+
The Recipe app keeps track of all your recipes, ingredients, and inventory. It will allow you to save ingredients, keep track of what you have, create recipes, and generate a shopping list based on what you have and what you are missing from a recipe. Also, since sharing recipes is an important part of cooking the app should allow you to make them public so anyone can access them.
7+
8+
## Built With
9+
10+
- Ruby on Rails
11+
12+
## Getting Started
13+
14+
### Prerequisites
15+
16+
- Ruby
17+
- Postgres server
18+
19+
### Setup
20+
21+
Clone this repo and enter the directory.
22+
23+
```sh
24+
git clone [email protected]:eapenzacharias/recipes-on-rails.git && cd recipes-on-rails
25+
```
26+
27+
### Install
28+
29+
Run the following command to install all the dependencies.
30+
31+
```sh
32+
bundler install
33+
```
34+
35+
### Usage
36+
37+
Run the following command to start the server, then go to http://localhost:3000
38+
39+
```sh
40+
rails db:create # create database
41+
rails db:migrate # migrate tables
42+
rails db:seed # load all data in database from seed.rb
43+
44+
bin/dev # necessary to start the app for the first time
45+
---- or ----
46+
rails s # can be used after starting the app at least once
47+
```
48+
49+
### Run tests
50+
51+
```sh
52+
bundle exec rspec spec
53+
```
54+
55+
## Author
56+
57+
👤 **Eapen Zacharias**
58+
59+
- GitHub: [@eapenzacharias](https://github.com/eapenzacharias)
60+
- Twitter: [@eapenzac](https://twitter.com/eapenzac)
61+
- LinkedIn: [LinkedIn](https://linkedin.com/in/eapenzac)
62+
63+
👤 **Piero Lescano**
64+
65+
- GitHub: [@piero-vic](https://github.com/piero-vic)
66+
- Twitter: [@v1ccenzo](https://twitter.com/v1ccenzo)
67+
- LinkedIn: [piero-lescano](https://linkedin.com/in/piero-lescano)
68+
69+
👤 **Luis Fernando Jimenez**
70+
71+
- GitHub: [@lu-jim](https://github.com/lu-jim)
72+
- Twitter: [@lujimhe](https://twitter.com/lujimhe)
73+
- LinkedIn: [@lujim](https://www.linkedin.com/in/lujim/)
74+
75+
## Show your support
76+
77+
Give a ⭐️ if you like this project!

app/controllers/foods_controller.rb

+3-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
# Food controller
44
class FoodsController < ApplicationController
5-
65
def new
76
@food = Food.new
87
end
@@ -43,11 +42,11 @@ def destroy
4342
private
4443

4544
def check_for_associations(food)
46-
if food.recipes.count > 0 || food.inventories.count > 0
45+
if food.recipes.count.positive? || food.inventories.count.positive?
4746
flash[:fail] = "Can't delete food in use"
48-
return false
47+
false
4948
else
50-
return true
49+
true
5150
end
5251
end
5352

0 commit comments

Comments
 (0)