Hello viewers .. I'm Doing a project on rails with mongoDB as a backend
database. When we learn a new programming language we start with writing
a helloworld program . In the same way if we want to work with a web
application we usually do a simple database connection .. We just create
a page with a single text box and a simple button . When we click the
button the data should be fetched from a database and showed in the
textbox . or otherwise when clicked the data in textbox should be sent
to the backend db . this is what we do . And i went through the same .
Used this tutorial
"http://moredevideas.com/getting-started-rails-4-with-mongodb/" Its
really superb . And i really executed it well and got it working . As
per the tutorial i executed the command
"rails generate scaffold product name description price:float" ..
It generated some of the files in the app/view folder and one the file
named "index.json.jbuilder" . And the file contains this code
"json.array!(@products) do |product|
json.extract! product, :id, :name, :description, :price
json.url product_url(product, format: :json)
end" ..
What does this code actually mean.i'm not able to understand it.. Any
suggestions would be helpful .
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit
https://groups.google.com/d/msgid/rubyonrails-talk/8ef0317c5684974aa5c231db54d43e03%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.