link_to helper
See also http://api.rubyonrails.org/
More RESTful Routes like
link_to "Profile", profile_path(@profile)
# => <a href="/profiles/1">Profile</a>
or the even pithier
link_to "Profile", @profile# => <a href="/profiles/1">Profile</a>
REST stands for Representational State Transfer. (It is sometimes spelled "ReST".) It relies on a stateless, client-server, cacheable communications protocol -- and in virtually all cases, the HTTP protocol is used.REST is an architecture style for designing networked applications. The idea is that, rather than using complex mechanisms such as CORBA, RPC or SOAP to connect between machines, simple HTTP is used to make calls between machines.
- In many ways, the World Wide Web itself, based on HTTP, can be viewed as a REST-based architecture.
RESTful applications use HTTP requests to post data (create and/or update), read data (e.g., make queries), and delete data. Thus, REST uses HTTP for all four CRUD (Create/Read/Update/Delete) operationIndex.html.erb - ListTweet.all in Rails 5 can be written as @Tweet.each do |tweet|
No comments:
Post a Comment