hi, I search google for this question but i did not find any solution for that. I want to save parameter value to database. this parameter send by url. for example: http://simple-beach-416.heroku.com/code/restserver?fname=cv I want to save fname value(here "cv") to database. how can i do that? -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 7 May 2011 12:17, farhad mahmoodi <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> hi, > > I search google for this question but i did not find any solution for > that. > > I want to save parameter value to database. this parameter send by url. > > for example: > http://simple-beach-416.heroku.com/code/restserver?fname=cv > > I want to save fname value(here "cv") to database. > how can i do that?params[:fname] will have the value "cv" in the controller action. Colin -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I generate a controller and call create model method with parameter: def add_item Pers1.create(:fname => params[:fn], :lname => params[:ln]) render :text => "Success!" end -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 7 May 2011 14:22, farhad mahmoodi <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> I generate a controller and call create model method with parameter: > > > def add_item > Pers1.create(:fname => params[:fn], :lname => params[:ln]) > render :text => "Success!" > endSorry, is there a question there? Colin -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Your code example shows params[:fn] Your example URL has fname=cv On 5/7/11, farhad mahmoodi <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> I generate a controller and call create model method with parameter: > > > def add_item > Pers1.create(:fname => params[:fn], :lname => params[:ln]) > render :text => "Success!" > end > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
this is correct: http://simple-beach-416.heroku.com/code/restserver?fn=p1&ln=p2 -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 8 May 2011 10:32, farhad mahmoodi <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> this is correct: > http://simple-beach-416.heroku.com/code/restserver?fn=p1&ln=p2Again, you must ask a question if you want help. All I see is the ''something went wrong'' message at that url. This comes from your file public/500.html in your application. If you are asking why a 500 error is occurring then the first question is whether it works ok on your development pc before you push it to heroku. If it does work ok there then look at the logs on heroku for more information. Colin -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.