I checked today and everything is in order (that is commented out as
is the default).
Do you mean i should have added 1 or more lines to the
"environment.rb" file??
Anyway, so for the sake of completeness, here is my code!
#models#
#----------#
#book model
has_many :book_authorities, :dependent => :delete_all
has_many :authorities, :through => :book_authorities
#authority_model
has_many :book_authorities, :dependent => :delete_all
has_many :books, :through => :book_authorities
#book_authority model
belongs_to :book
belongs_to :authority
auto_complete_for :authority, :surname
#view#
#------#
<div class="book_authority">
<% fields_for "book[book_authority_attributes][]",
book_authority, :index => nil do |bookauthority_form| %>
authority: <%= bookauthority_form.select(:authority_id,
$allnames)
%> <br />
capacity: <%= bookauthority_form.text_field :capacity,
:index =>
nil %> <br />
<% if book_authority.new_record? %>
<%= link_to_function "remove", "$(this).up
('.book_authority').remove()" %>
<% else %>
<%= link_to_function "remove",
"mark_for_destroy_ba(this)" %>
<%= bookauthority_form.hidden_field :id %>
<%= bookauthority_form.hidden_field
:should_destroy, :index =>
nil, :class => 'should_destroy' %>
<% end %>
<% end %>
</div>
#controllers#
#---------------#
#application_controller
def update_authorities
#...@allauthorities = Authority.find(:all, :limit => 5000, :order =>
"id ASC")
@allauthorities = Authority.find(:all)
$allnames = Hash.new()
for a in @allauthorities
$allnames.merge!({ ((a.surname || "") + " " + (a.name || "") +
"," + (a.short_title || "")) => a.id})
end
end
On Feb 14, 6:55 pm, Frederick Cheung <[email protected]>
wrote:
> On Feb 14, 3:52 pm, "Spiros K." <[email protected]> wrote:> Yes, the plugin
> IS in vendor plugins and YES you can check my first
> > post in the thread and see that my 2nd post was actually a typo in my
> > behalf. The problem remains as stated.
>
> odd. i'd stick a breakpoint in the plugin's init.rb to see what was
> happening there (you should have vendor/plugins/auto_complete/init.rb
> and vendor/plugins/auto_complete/lib ) If you have changed
> config.plugins or config.plugin_paths in environment.rb that could
> cause this (but I rather suspect you'd remember if you'd done that).
>
> > BTW, the code was copy-pasted from tutorials that supposedly work, so
> > I doubt there is any weird typo in the actual code.
>
> I wouldn't be so sure :-)
>
> Fred
>
>
>
>
>
> > On Feb 14, 12:41 pm, Frederick Cheung <[email protected]>
> > wrote:
>
> > > On Feb 14, 9:58 am, "Spiros K." <[email protected]> wrote:> Thanks for
> > > your reply,
> > > > but
>
> > > > 1. this specific plugin did not have an install.rb with it.
> > > > 2. 2.2.2 is as new as they get I just downloaded 3 weels ago...?! And
> > > > i think it works just fine with git as I have downloaded from git as
> > > > well (though it messed my tortoise svn structure pretty badly)
>
> > > so is the plugin in vendor/plugins ?
>
> > > > Then fired up my script/server and still:
>
> > > > "method not found" for autocomplete_for method!!! :-(
>
> > > I also assume that that was a typo and you actually write
> > > auto_complete_for in your controller.
>
> > > Fred
>
> > > > On Feb 13, 12:55 pm, Frederick Cheung <[email protected]>
> > > > wrote:
>
> > > > > On 13 Feb 2009, at 09:19, Spiros K. wrote:
>
> > > > > > page not found" error
>
> > > > > > * Trying to manually copy the files in the vendor/plugin directory
> > > > > > of
> > > > > > my project (got them from the model_auto_completer example), but
> > > > > > still
> > > > > > does not work... (if i execute "script/plugin list" there is
> > > > > > nothing)
>
> > > > > > Regarding this last part, i have been trying to find documentation
> > > > > > about how to manually install a plugin, but with no results. In
> > > > > > every
> > > > > > forum that someone asks "how to do it manually" people respond with
> > > > > > "script/plugin install". This is automatic, not manually, as i am
> > > > > > sure
> > > > > > most of you know. What i am searching for is instructions on: where
> > > > > > to
> > > > > > place the files myself and what to execute myself so that my project
> > > > > > will 'use' the plugin.
>
> > > > > Copying the files into vendor/plugins is all there is to it 99% of
> > > > > the
> > > > > time. Some plugins have an install.rb file that needs to be run after
> > > > >
> > > > > this.
> > > > > Don't worry about the output of script/plugin list (which as far as I
> > > > >
> > > > > can tell is for listing available, not installed plugins)
>
> > > > > The autocomplete plugin is on github these
> > > > > days:http://github.com/rails/auto_complete/tree/master
>
> > > > > Newer versions of rails include a version of script/plugin that can
> > > > > install plugins from git repositories (assuming you have git itself
> > > > > of
> > > > > course).
>
> > > > > Fred
>
> > > > > > I will be thankful for any help you might offer, no matter how
> > > > > > small,
> > > > > > but PLEASE don't repeat to me steps i have already taken with no
> > > > > > differentation what-so-ever. This is both pointless and insulting.
>
> > > > > > Yours sincerely,
> > > > > > a frustrated RoR programmer
> > > > > > Spiros K.- Hide quoted text -
>
> > > - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" 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/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---