Ruby on Rails Friday, March 6, 2015

On Fri, Mar 6, 2015 at 8:49 PM, Colin Law <clanlaw@gmail.com> wrote:
> What have you got in routes.rb to provide the route?

route.rb

resources :pages do
member { post :mercury_update }
end

pages_controller.rb

def mercury_update
page = Page.find(params[:id])
page.subject = params[:content][:page_subject][:value]
page.regard = params[:content][:page_regard][:value]
page.regardContent = params[:content][:page_regardContent][:value]
page.save!
render text: ''
end


--
Cheers!

Deepak Kumar Sharma
Blog: http://deekysharma.wordpress.com

" Mistakes are proof that you are trying "

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CALDHwN6eyEV1jdM8C5R0wsO-OTAgbfRHcK%3DQmVCnuixCqPxvBg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment