Ruby on Rails SQlite 3 database query -
i have been looking online how queries ruby on rails , can find information how build query not put physical code. new ruby on rails.
i have 1 database called story , has title , content columns made. have page used input title , content , stored database , have page displays contents of database not understand how query find let's say, "a record has content or title contains word or phrase"
<%= @story.content %>
so understand displays content on screen, same thing queries?
in rails active records used not direct sql queries
here's link explains ......
http://guides.rubyonrails.org/active_record_querying.html
for example lets have post model , want
index posts use
@posts = post.all
you want show specific post ,find id
@post = post.find(params[:id])
create new post
@post = post.new