Displaying 20 results from an estimated 4000 matches similar to: "Is this a weird bug with auto_complete?"
2006 May 08
3
Can you have multiple before filters?
Hi,
Is it possible to specify multiple before filters in a controller...
here''s the thing: only one set of filters is to use the :except option.
Something like:
before_filter :check_for_session_cookie
before_filter :validate_user :except =>[''login'']
which I use to a) check if the user has returned to the site and has a
saved cookie holding login details b) check
2006 May 02
6
Is there a link_to ''external url''?
I''ve checked the Rails documentation but find no mention of link_to
''external url'' or equivalent. Does rails have a built in method to do
this?
thanks
-Lindsay
--
Posted via http://www.ruby-forum.com/.
2006 Apr 06
10
Advice needed on tracking down unusual error
Does anyone have advice on how to go about locating the cause of this
error message:
ActionView::TemplateError (wrong number of arguments (3 for 1)) on line
#4 of app/views/products/search.rhtml:
4: <%= start_form_tag :action => ''search'' %>
I don''t see anything wrong with line 4 above.
Some background: I''ve made a number of changes to Controllers,
2006 Apr 29
5
HABTM - how to insert join row when associated rows exist
I have successfully used HABTM to create a many-to-one-to-many set of
rows in one step. Now, if two objects I want to associate already exist,
how do I create the join row? The Agile book mentions the
''push_with_attributes'' method. The text says this method is useful for
adding additional attributes to the join row (in the example a ''read_at''
timestamp). I
2006 May 02
5
does not equal conditional
I am trying to figure out how to write a conditional statement that will
execute only if a specified variable is not empty.
Right now my view looks like this:
<dt>Building Regulations</dt>
<% for link in @cat1 %>
<dd><a href="<%= link.url %>"><%= link.title %></a></dd>
<% end %>
Action:
@cat1 = Link.find(:all, :conditions
2006 Apr 20
2
Is there a problem with Agile code in Web 2.0 chapter?
Hi, I''m running the code example for ''Dynamically Updating a List'' in
Agile pages 404-406:
When I enter a new to-do, and click ''New Item'', a new page is rendered
only displaying the new to-do just entered. This isn''t what''s expected.
The to-do list with id="items" should be updated so the to-do list
dynamically grows.
2006 Feb 28
2
acts_as_taggable and auto_complete
I''m using the acts_as_taggable gem (who''s site has gone AWOL
apparently) and I''m wanting to make it autocomplete. I, however, am
the absolute worst JavaScript person ever, so is there anyone out
there that can point me to a tutorial or give some good starting
points? Thanks!
Kenneth
--
=> the blog from beyond <=
=> www.eyeheartzombies.com <=
2006 Mar 21
4
Can RoR''s AJAX helpers do this?
Hi,
I want to type text into an input field then on enter, use AJAX to
update the value of an input field elsewhere on the screen.
''observe_field'' allows me to watch a form field and dynamically update a
DIV. Is there a variation or other method to allow me to update a field
instead?
--
Posted via http://www.ruby-forum.com/.
2006 Mar 25
3
validates_presence_of validation order?
I have a form with 3 fields: user_id, email and password.
All 3 fields are required, so I have a "validates_presence_of :user_id,
:email, :password" in my model.
Works, but the validation errors show up in a different order than I
specificed in the validates_presence_of statement.
Is there a way to specify the order in which the validations (and
corresponding error messages) should
2008 Jun 12
11
auto_complete with multiple params
I''m using the auto_complete plugin, and it works great, my problem is i
need to pass multiple parameters to the controller other that what is
typed in the text field.
<%= text_field_with_auto_complete :search, :contains, :size => 15,
:frequency => 0.1, :skip_style => true -%>
This is what i have as of now, but i also need to pass ":language =>
@default"
2007 Feb 06
3
Form won't accept ampersand
Hi guys,
My start_form_tag generated form will not accept a text field containing
an ampersand.
For example, the text ''A & B'' is trunacted to ''A'' in the param hash.
I know ampersands have to be encoded in URLs, but I''m surprised my form
has a problem with this. I''ve tested this in Safari and Firefox.
thanks
Lindsay
--
Posted via
2006 Feb 20
4
SHow do you suppress ERB newlines globally
Is there a config flag to suppress the newline at the end of every ERB
''%>'' tag, so it would not be necessary to type ''-%> each time?
--
Posted via http://www.ruby-forum.com/.
2006 May 11
3
Textile/RedCloth and h() incompatible?
If a user enters the Textile-based code for an image, say:
!>graphic.png!
the textile() method will successfully render a right-float image. Now,
if I want to escape the user''s text using h(), the ''>'' is turned into an
&. Obviously, the image then fails to render in a browser. Is there
a work around for this?
I guess what I''m really asking
2006 Jan 07
10
RMagick bus error on OS X in console mode
This is a strange bug that I''ve never seen before. It only shows up
when I run the app through the console (the app is Family Connection,
and it works fine when run as a web app):
22$ ruby script/console
Loading development environment.
>> User
/opt/local/lib/ruby/vendor_ruby/1.8/powerpc-darwin8.3.0/
RMagick.bundle: [BUG] Bus Error
ruby 1.8.2 (2004-12-25)
2006 Mar 12
0
undefined method and auto_complete
pulling my hair out on this because I don''t understand...
I have 2 methods/actions in the same ''placements'' controller that I am
concerned with...
find, works properly...
view code from find.rhtml
<td><p><label>Client</label><br/>
<%= text_field_with_auto_complete :placement, :clwholename, {} %>
</p>
</td>
2010 May 05
0
Auto_complete with has_one association
Hi,
Have an issue with the rails auto complete, it works fine but I don''t
know how to find the id element search in the textfield.
Here is what I''ve done:
<%= text_field_with_auto_complete :user, :ville_name, { :size => 15 },
{ :url => formatted_villes_path(:js), :method => :get, :param_name =>
''search'' } %>
Model:
class User <
2009 Sep 23
4
auto_complete text field not showing drop-down box properly
This may be more of an Ajax question than a Rails question, but I''m
pretty new to Rails and know approximately zero JS. I''d love if
someone could give me a little direction.
I''m using pat shaughnessy''s nested text_field_with_auto_complete
plugin, and it seems to be *mostly* working properly (after many hours
of fiddling). However, the drop-down box is not
2006 Feb 22
3
Unit test failure - nil object?
I''m following instructions in the Agile book, page 146 for testing an
object update to the database. Here''s my code:
def test_update
assert_equal "jack@smiths.com", @user.email
@user.email = "jack@smiths.org"
assert @user.save, @user.errors.full_messages.join("; ")
@user.reload
assert_equal @user.email,
2006 Mar 03
2
Accessing cookie and session objects
Is it possible to directly access session and cookie objects from within
a Model? When I try to read the session object in my User Model I get
the following error:
NameError (undefined local variable or method `session'' for User:Class):
I could pass attributes taken from the session into my method in the
User Model, but this seems to go against DRY.
-Lindsay
--
Posted via
2006 Feb 15
2
First unit test fails
I''ve just started working through ''Agile'' chapter 12
''Testing''. I''ve followed the steps carefully, setting up a fixture and
unit test to check the creation of an order. When I run the test I get
the following:
Loaded suite test/unit/order_test
Started
F
Finished in 0.108008 seconds.
1) Failure:
test_create(OrderTest)