How To Build A Recipe Box In Rails 4
Why Stack Overflow recommends it
Stack Overflow users link it when answering questions about nested forms in Rails, especially adding dynamic ingredient-style fields with the Cocoon gem, and as a starter Rails project.
Recommended by 2 people across 2 different months, 2015 to 2017.
What it is
A full-length Rails 4 tutorial by Mackenzie Child, part of his 12 Web Apps in 12 Weeks series, that builds a recipe box app with users, recipes, ingredients and steps. It uses Devise, Paperclip, Cocoon and Bootstrap-Sass, with nested forms as the main technique.
What people said
Strong rec neanderslob · 2015-10 · Stack Overflow · on “Ruby on Rails: Complex Form Generation”
If I'm understanding your plight correctly, this is a job for Cocoon! Cocoon allows you to generate dynamic nested fields (as many as you want). So what I'd do is: install the cocoon gem [LINK] Watch this video [this video] You can fast forward to where he's showing how to dynamically add ingredients to recipes but really this entire tutorial is a FANTASTIC reference that will save you lots of googling. Then in your pizza order view, render a partial (just as you said) only do it with cocoon. <%= simple_form_for @order do |t| %> <%= t.simple_fields_for :pizza_orders do |po| %> <%= render 'order_fields', p: po %> <% end%> <div class="add-field"><%= link_to_add_association 'Add Pizza Order', t, :pi
Recommends VegaStudios · 2017-03 · Stack Overflow · on “database recommendation for an offline html cookbook”
One of the tenets of Rails is you shouldn't really care what database you're using: that's all abstracted for you. I know it's kind of diverging from your skillset, but Rails would be a great approach for an application like this, especially if you want to deploy to a server instead of running it locally down the road. Check out some 12 in 12 tutorials by Mackenzie Child, [this video]
Cites Matthias Cordes · 2016-09 · Stack Overflow · on “Local variable in Ruby on Rails is undefined”
I am currently following a recipe box [this video] tutorial on youtube. When I open the rails console and type @recipe = current_user.recipes.build I got the following error: NameError: undefined local variable or method `current_user' for main:Object from (irb):3 from /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/railties-5.0.0.1/lib/rails/commands/console.rb:65:in `start' from /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/railties-5.0.0.1/lib/rails/commands/console_helper.rb:9:in `start' from /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:78:in `console' from /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems/railties-5.0.0.1/lib/rails/com