then BAM! I hit an Exception and can't figure out where to look to
identify what got broken! :(
I'm working on a simple app to assign engineers to projects... the
models are equivalent to the Recipe/Category relationship in the Rapid
Rails With Hobo book...
engineer...
has_many :projects, :through => :jobs
has_many :jobs, :dependent => :destroy
job...
belongs_to :project
belongs_to :engineer
project
has_many :engineers, :through => :jobs, :accessible => true
has_many :jobs
So on the edit page for a project I have an <Add Engineer> dropdown.
When i use it, the engineer gets added to the page OK, but when I hit
Save ... i get the exception...
ActiveRecord::RecordInvalid in ProjectsController#update
Validation failed: Name can't be blank
As far as I can see the project name, engineer name and job name are
not blank. Any guidance on where to look to track down this bug or how
to read the traces in general would be much appreciated
Paul
Well, posting the trace will help. :)
Posting the DRYML for the form will be handy as well; my guess is that
you've got a setup where somehow a Job is being created that doesn't
pass validation (if you set up a Project and an Engineer in the
console, does:
project.engineers << engineer
work?)
Hope this helps!
--Matt Jones
i'm not just new to hobo... new to rails and ruby too so lots to
learn :-)
--
You received this message because you are subscribed to the Google Groups "Hobo Users" group.
To post to this group, send email to hobo...@googlegroups.com.
To unsubscribe from this group, send email to hobousers+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/hobousers?hl=en.
I have a few thoughts on the documentation already from my strange pov
(ie new to hobo, rails and ruby... but not new to sw engineering)...
- given hobo looks like a supercharged version of rails i guess lots
of people come here withour knowing ruby or rails. it would be great
if the hobo docs could point to some key "getting started" resources
for both rails and ruby. you guys must have seen lots of
documentation, so you probably know where the best stuff is. i'm
getting there the slow way ... reading a book on ruby... then "Rails
2" awaits...
- believe it or not i only realized there *was* a console as a result
of Matt's email reply to my noob question! the console makes a big
difference for debugging, obviously :-) ... a tutorial or screencast
showing use of the console to explore the model etc could help clue
new folks in to what's going on...
- i'd really like to see info about what to do when things *don't*
work in hobo/dryml. for example I have two problems, both apparently
related to dryml tags, and so far i have no clue where to look to
solve either of them...
problem 1: i've got a <table-plus> list working, but when i click on
the column headers it doesn't sort the table - the url gets sort=
added, but the row order stays the same.
problem 2: i've put a lifecycle into my little app, following along
pretty much as in the examples... but when i add the <transition-
buttons> tag, nothing happens - no errors, no buttons.
thanks again
Paul
> > hobousers+...@googlegroups.com<hobousers%2Bunsu...@googlegroups.com>
http://railscasts.com/episodes/48-console-tricks
http://railscasts.com/episodes/54-debugging-with-ruby-debug
Google is your friend for finding rails documentation. Just search e.g
"rails validation" and look for the link starting with
api.rubyonrails.org/...
If you are having a problem that you can't solve and won't ask it in
the hobo forum try to stackoverflow.com - this is a great rails,
ruby, database, + forum.
Best regards.
Asbjørn Morell
On Apr 5, 6:02 am, atmorell <atmor...@gmail.com> wrote:
> http://railscasts.com/is a great place to start if you are new to
> rails/ruby. Please check if the screencast has been updated if it is a
> old version. There is a lot of examples and even a console and
> debugging tutorial ;)
>
Which I don't think is uncommon in this community.
>
> - given hobo looks like a supercharged version of rails i guess lots
> of people come here withour knowing ruby or rails. it would be great
> if the hobo docs could point to some key "getting started" resources
> for both rails and ruby. you guys must have seen lots of
> documentation, so you probably know where the best stuff is. i'm
> getting there the slow way ... reading a book on ruby... then "Rails
> 2" awaits...
OK, I've created a ticket
https://hobo.lighthouseapp.com/projects/27184-hobo-cookbook/tickets/21-add-manual-section-with-pointers-to-resources-for-rails-ruby
to add a section to the manual. People can add resources by commenting
on that ticket or just commenting in this thread.
Another location is this older ticket:
https://hobo.lighthouseapp.com/projects/8324/tickets/443-faq which talks
about creating an FAQ for hobocookbook.
>
> - i'd really like to see info about what to do when things *don't*
> work in hobo/dryml. for example I have two problems, both apparently
> related to dryml tags, and so far i have no clue where to look to
> solve either of them...
>
> problem 1: i've got a <table-plus> list working, but when i click on
> the column headers it doesn't sort the table - the url gets sort=
> added, but the row order stays the same.
OK, that definitely qualifies as a bug in the documentation. Sort
requires controller support. If you can't figure it out from the
agility example, post back. I opened a ticket to make sure we add the
docs before 1.1.
>
> problem 2: i've put a lifecycle into my little app, following along
> pretty much as in the examples... but when i add the <transition-
> buttons> tag, nothing happens - no errors, no buttons.
This is most likely a problem in your :available_to options on your
transitions. Sometimes it's helpful to use transition-button rather
than transition-buttons because it may give error messages rather than
silently omitting invalid transitions.
Bryan
To unsubscribe from this group, send email to hobousers+...@googlegroups.com.
i've solved the two dryml tags issues now, thank you. i guess i got so
excited by hobo i was expecting it all to work by magic :-)
> > <hobousers%2Bunsu...@googlegroups.com<hobousers%252Buns...@googlegroups.com>
http://www.themomorohoax.com/2009/02/09/use-debugger tutorial on using
rails debugger
also some useful techniques are adding raise variable_name.inspect in
controller and <%= variable.inspect %> in views for when you just need
a quick peek at what's happening.