Just a note ... here's the update link to lighthouse (since the moved
the project around) 
http://datamapper.lighthouseapp.com/projects/20609/tickets/664-no-record-update-after-upgrade-to-097

On Nov 26, 10:09 pm, tongueroo <[EMAIL PROTECTED]> wrote:
> Andre,
>
> I am getting the same type of error.  I upgraded from merb 1.0 to
> 1.0.3 and datamapper 0.9.7 to 0.9.8.  Have you made any progress?
>
> Thanks,
> Tung
>
> On Nov 22, 11:32 am, Andre <[EMAIL PROTECTED]> wrote:
>
> > Ok, so I upgraded to Merb 1.0.1 and DataMapper 0.9.7. The thing is
> > that now the update function of my controller is completely broken.
> > Let me explain better.
>
> > I'm doing some very basic stuff. I create my app, set up the database
> > and then generate my resource with:
>
> > merb-gen resource article title:string,author:string
>
> > I then ran the rake db:automigrate command, to sync my database. After
> > that I've created my views following exactly the examples listed 
> > here:http://wiki.merbivore.com/howto/crud_view_example_with_merb_using_erb
>
> > Then I proceed to actually create my first content. All's fine. The
> > record is created and correctly displayed. Still, when I go and edit
> > it the data isn't saved. Let me clarify that I haven't touched a
> > single thing in my controller.
> > "It could be a DataMapper problem", I thought. So i ran "merb -i" and
> > tried to do stuff from there:
>
> > Article.get(1).update_attributes(:title => "My new title")
>
> > And the record gets updated just fine. By the way, the problems
> > persists even if I use ActiveRecord.
> > So I've tried to se if it was a merb problem by modifying the update
> > method of my controller like this, you know just to do some
> > experiments to get at least a hint of what's going on:
>
> >   def update(id, article)
> >     @article = Article.get(id)
> >     raise NotFound unless @article
> >     if @article.update_attributes(:title => "bla bla bla")
> >        redirect resource(@article)
> >     else
> >       display @article, :edit
> >     end
> >   end
>
> > The record is updated again, and "bla bla bla" is my new title. Then I
> > restored the fourth line of the code posted above to what's
> > automatically generated by merb-gen:
>
> > ...
> >     if @article.update_attributes(article)
> > ...
>
> > Again, nothing saved. It seems to me like the article variable isn't
> > read by the @article.update_attributes function, at all :/
>
> > What could be wrong? I've updated all the gems, and I've done some
> > very basic stuff, with no models relationships established, nor
> > validations etc... Any ideas about this very weird behaviour?
>
> > Thankyou so much in advance.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to