Neophyte scaffold question


#1

JRubyat,

i’m testing some JRuby -> Scala code paths. To avoid a lot of cruft with
some legacy code context, i’ve taking an existing JRuby site and done
two
things.

  • generated fresh model classes from the DB (see script below)
  • for i in mysql -u root -p -e "use <myproj>_development; show tables;" | grep -v Tables_in_<myproj>_development; do echo $i;
    script/generate model
    $i; done
  • generated fresh controller and views from the DB (see script below)
  • for j in for i in ./app/models/*.rb; do echo "${i##*/}"; done; do
    echo "jruby script/generate scaffold ${j%.}"; jruby
    script/generate
    scaffold ${j%.
    }; done

Everything seems hunkydory, but when i point my browser at one of the
paths
http://localhost:3000/myproj_activities, i get the following [1].

When i look in the index.html.erb file i do indeed see [2]. The
referenced
variable JRuby is complaining about is mentioned in the index.html.erb
file.
i think i know what value to define the variable to be, i just don’t
know
what class i should define it on. Any clues?

Also, a meta-level question: should this variable have been defined as a
part of the scaffold generation step? Did i miss something in my use of
scaffold?

Best wishes,

–greg

[1]
NameError in Myproj_activities#index

Showing myproj_activities/index.html.erb where line #18 raised:

undefined local variable or method `new_myproj_activities_path’ for
#ActionView::Base:0xb29cb5

Extracted source (around line #18):

15:
16:

17:
18: <%= link_to ‘New myproj_activities’, new_myproj_activities_path %>

[2]

Listing myproj_activities

<% for myproj_activities in @myproj_activities %>

<% end %>
<%= link_to 'Show', myproj_activities %> <%= link_to 'Edit', edit_myproj_activities_path(myproj_activities) %> <%= link_to 'Destroy', myproj_activities, :confirm => 'Are you sure?', :method => :delete %>

<%= link_to ‘New myproj_activities’, new_myproj_activities_path %>


L.G. Meredith
Managing Partner
Biosimilarity LLC
806 55th St NE
Seattle, WA 98105

+1 206.650.3740

http://biosimilarity.blogspot.com


#2

JRubyat,

Nevermind. i resolved the issue.

Best wishes,

–greg

On Mon, Mar 9, 2009 at 1:23 PM, Meredith Gregory
removed_email_address@domain.invalidwrote:

  script/generate model $i; done

variable JRuby is complaining about is mentioned in the index.html.erb file.

16:

Seattle, WA 98105

+1 206.650.3740

http://biosimilarity.blogspot.com


L.G. Meredith
Managing Partner
Biosimilarity LLC
806 55th St NE
Seattle, WA 98105

+1 206.650.3740

http://biosimilarity.blogspot.com