Adds basic vuejs functionnality, implements RecipeCategory custom field
This commit is contained in:
@@ -15,7 +15,7 @@ fn main() {
|
||||
|
||||
println!("Here are {} recipes :", result.len());
|
||||
for rec in result {
|
||||
println!("*************\n{}", rec.title);
|
||||
println!("*************\n{}\n({:?})", rec.title, rec.category);
|
||||
println!("-------------\n");
|
||||
println!("{}", rec.ingredients);
|
||||
}
|
||||
|
||||
@@ -4,11 +4,12 @@ extern crate diesel;
|
||||
use std::io::{Read, stdin};
|
||||
use diesel::SqliteConnection;
|
||||
use self::cookbook::*;
|
||||
use self::models::NewRecipe;
|
||||
use self::models::{NewRecipe, fields::RecipeCategory};
|
||||
|
||||
struct CreateRecipe<'a> {
|
||||
connection: &'a SqliteConnection,
|
||||
title: &'a str,
|
||||
category: Option<RecipeCategory>,
|
||||
ingredients: String,
|
||||
}
|
||||
|
||||
@@ -17,6 +18,7 @@ impl<'a> CreateRecipe<'a> {
|
||||
CreateRecipe{
|
||||
connection: conn,
|
||||
title: "New recipe",
|
||||
category: None,
|
||||
ingredients: String::new(),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user