great!, I needed serialize errors too. Thanks ! On Dec 17, 3:57 pm, "Martin Gamsjaeger" <[email protected]> wrote: > Hey Joshua, > > I just added a patch that allows dm-serializer to do its thing on > DataMapper::Validate::ValidationErrors objects. > > http://datamapper.lighthouseapp.com/projects/20609/tickets/718-patch-... > > Also, I'm almost finished adding configurable support for "provides" > to merb_resource_controller. Again, thx a lot for your initial patch! > I just wanted to have it a bit more configurable, and since my git fu > is very weak and I was ahead with my codebase by the time you sent the > pull request, I couldn't merge yours in. > > I hope the next version of merb_resource_controller meets your needs! > > cheers > snusnu > > On Fri, Dec 5, 2008 at 08:17, Joshua Bassett <[email protected]> wrote: > > > Hi Merb-peeps, > > > Consider this rails-esque create action from an Article resource > > controller: > > > def create(article) > > @article = Article.new(article) > > if @article.save > > case content_type > > when :xml > > display @article, :status => 201, :location => resource(@article) > > else > > redirect resource(@article), :message => { :notice => "Article > > was successfully created" } > > end > > else > > case content_type > > when :xml > > display @article.errors, :status => 422 > > else > > message[:error] = "Article failed to be created" > > render :new > > end > > end > > end > > > Everything works nicely except for: > > > display @article.errors > > > The display method attempts to call to_xml on the ValidationError > > object, but it is not implemented by the dm-serializer gem. > > > Is this an oversight of dm-serializer, or am I missing the merbful way > > of doing this? > > > Best, > > > Josh
--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "merb" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/merb?hl=en -~----------~----~----~----~------~----~------~--~---
