Forum: JRuby Neophyte scaffold question

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Meredith Gregory (Guest)
on 2009-03-09 23:24
(Received via mailing list)
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: <br />
17:
18: <%= link_to 'New myproj_activities', new_myproj_activities_path %>


[2]
<h1>Listing myproj_activities</h1>

<table>
  <tr>
  </tr>

<% for myproj_activities in @myproj_activities %>
  <tr>
    <td><%= link_to 'Show', myproj_activities %></td>
    <td><%= link_to 'Edit',
edit_myproj_activities_path(myproj_activities)
%></td>
    <td><%= link_to 'Destroy', myproj_activities, :confirm => 'Are you
sure?', :method => :delete %></td>
  </tr>
<% end %>
</table>

<br />

<%= 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
Meredith Gregory (Guest)
on 2009-03-09 23:41
(Received via mailing list)
JRubyat,

Nevermind. i resolved the issue.

Best wishes,

--greg

On Mon, Mar 9, 2009 at 1:23 PM, Meredith Gregory
<removed_email_address@domain.invalid>wrote:

>       script/generate model $i; done
> variable JRuby is complaining about is mentioned in the index.html.erb file.
>
> 16: <br />
>
>
> 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
This topic is locked and can not be replied to.