Hello,
I am using Sinatra to write an application that would act on GET, POST,
PUT and DELETE actions. I have coded the GET part as follows-
[code]
get ''/'' do
    @CNs = Data.all()
    erb :index
end
[/code]
The index.erb in ./views has all the rendering logic.
Thus, the get block calls the index.erb file. How should POST and PUT
should be coded ?
[code]
post ''/addnew/:id'' do |id|
    erb :addnew
end
[/code]
If addnew.erb will POST and action will be ''/addnew/5'', then
it will
call the post block again, Isn''t ?
I think, I shouldn''t call the [B]erb :addnew[/B]. Instead something
else
should be done.
I am sure this is a very basic thing and a lot of people could have gone
through this step earlier. Any suggestion ?
Thanks in Advance,
+Vipul ;
-- 
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 post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---