nathanvda / cocoon_simple_form_demo Goto Github PK
View Code? Open in Web Editor NEWa small Rails application demonstrating nested forms with cocoon and simple_form
a small Rails application demonstrating nested forms with cocoon and simple_form
if during rake db:migrate the following error occurs:
NoMethodError:
undefined method last_comment' for #<Rake::Application:0x007f2e4ce09cd8>
then a quick fix can be edit ./Rakefile and add these lines before calling Rails.application.load_tasks
require File.expand_path('../config/application', __FILE__)
require 'rake'
+ module TempFixForRakeLastComment
+ def last_comment
+ last_description
+ end
+ end
+ Rake::Application.send :include, TempFixForRakeLastComment
CocoonSimpleFormDemo::Application.load_tasks
@nathanvda - I have made sure the rest of codes are exactly like as your demo example.
Using:
rails (4.1.8)
simple_form (3.1.0)
undefined method `reflect_on_association' for NilClass:Class
When you called:
<%= link_to_add_association 'Add', f, :study_plan_subjects %>
The rest of code are exactly like this example.
sorry, not the good place for that...
It's not clear why we're including therubyracer in the Gemfile.
How would I go about displaying images from a partial in a view using this gem. For example, I have a profile that has many products. In my view I have something like this for text fields:
<% @editprofile.products.each do |product| %>
<strong>Product/Service:</strong>
<%= product.prodserv %>
<strong>Product Description:</strong>
<%= product.productdesc %>
<% end %>
What should I put to display images from the product partial?
Product Partial:
<div class='nested-fields'>
<p><b> Product (s) Name (Max 75 characters): </b></p>
<%= f.input :prodserv, label: "Products" %>
<p><b>Description</b> (Maximum 500 Characters)</p>
<%= f.input :productdesc, label: "Product Description" %>
<p><b>Upload Pictures: </b>(Note: You can upload a total of two files (picture, audio, video, ppt, MSWord, Excel)
for each product or service)</p>
<%= f.file_field :upload %>
<%= f.file_field :upload2 %>
<p><b>Attached Product Information</b></p>
<%= f.file_field :urlimage %><%= link_to_remove_association "remove url", f %>
<%= f.input :url, label: "Product URL" %>
</div>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.