def add
if params[:note_add] == "Add"
Note.create({:user_id => @user["id"], :note_type => params[:type], :text => params[:note_text], :lng => params[:lng], :lat => params[:lat]})
end
end
I am new on Ruby on Rails and I am trying to get data from database. How could i do it?
If you are using a relation DB like MySQL, Postgres or other you should use Active Record that RoR brings. It’s a ORM and provides plenty of functionalities for interacting with DB, and it seems your are already using it. For querying data check this page on the guides.
http://guides.rubyonrails.org/active_record_querying.html
Some examples