RESTFul Routes
Custom Routes
Named Routes
How to Redirect
Root Route
Route Parameters - Part 1
Route Parameters Part 2
Route Parameters Part 3
Chee Chong Hwa aka CCH, a Malaysian Chief Software Architect blogs on his experiences with Ruby on Rail running on Win2003 Server+Apache 2.26 environment since 2007. Flirted briefly with Ubuntu 9.04 in 2009. Since January 2017, now using RubyMine IDE/Notepad++ to work with Ruby 2.26 +Rails 5.01+Apache 2.4.23 + MySQL 5.7.14 on Windows 10 64-bits.
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|
t={id:, status: "Delicious Brains", zombie:"Jim"}
Read Recipe Variable[:key] => value Example t[:id]=3 t[:status]="Delicious Brains" t[zombie]="Jim"
ANSWER: t=Tweet.find(3)
{id: 3, status: "Delicious Brains", zombie:"Jim"}