similar to: AJAX Search w/database results

Displaying 20 results from an estimated 5000 matches similar to: "AJAX Search w/database results"

2006 Jan 12
3
url_for in tests
Hi there, I''ve added an extra bunch of testing features for doing in-browser testing with Selenium, and am having quite a time figuring out how to use url_for with having a controller object present. I''ve tried using ActionController::Base.url_for and ActionView::Helpers::UrlHelper.url_for but haven''t been able to get something that works. What I want to be able
2006 Mar 03
6
has_one :next - invalid name?
I have this in a model: has_one :next, :class_name=>''WorkPart'', :foreign_key=>''next_id'' And it causes this error: compile error /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.13.1/lib/active_record/deprecated_associations.rb:83: void value expression
2006 Feb 14
4
Escaping the AJAX View
I have a login form, in which I use a "form_remote_tag". I''m redirecting users to this form when they fail authentication as well... and using the "jumpto" method of capturing they original URL they requested via request.parameters, and redirecting to this URL after they authenticate. Problem is, if I try to do a "redirect_to", this won''t work, as
2006 Jan 25
3
Application Helper and Javascript
I have a "javascript_include_tag" including a Javascript function. I have a function being invoked via a helper in the same view, which prints out a script tag that uses the javascript function above. Problem is, the function being invoked via the helper can''t find the javascript function included in the "javascript_include_tag". I hardcoded the javascript that
2006 Jan 25
2
Using ''GET''-method in Forms
Hi all, I''m using a selection-list / dropdown-list to choose an element in a number of grouped elements. Is there a way of passing an element_id to the form AND using the HTTP-''get''-method? I found that the <% start_tag %> has a :method-switch as an option, but it passes the arguments on like "/controller/action/?action=1". I would need something like
2006 Feb 17
4
Best practice for showing errors AND updating list
Morning/Afternoon/Evening All, This is my first post to the ruby message board so if my request is better suited to another location just let me know, The problem I keep coming up against is with a listing of objects and updating that list via AJAX (for arguments we are talking about a list of users). As it stands I can currently submit a form, and update the list (using :update
2006 Mar 07
3
STI and unit testing
Hi all, I''m having a bit of a problem with unit testing. I''ve simplified my models to try and get my head round it but I''m still struggling. I''m using STI and trying to write tests for the extended models (code below). I''ve written test cases for the extended models which themselves extend the test case for the parent model, so BarTest extends
2006 Jan 25
8
conditional replacements in rhtml
I am working on the Agile programming tutorial and trying out some ruby code. Can someone tell me why the following works: <h1>Display Cart</h1> <p> Your cart currently holds <%= @items.size %> <%= @items.size == 1 ? "item" : "items" %>. </p> while this does not? <h1>Display Cart</h1> <p> Your cart currently
2006 Jan 04
4
Multiple emails from one SMTP connection?
Hi all. I''m running a nightly job that is creating a CSV file and sending to member via SMTP. I got the following error after about 20 emails or so: Net::SMTPServerBusy Too many connections from IP... Is there a way (using ActionMailer) to open a connection and send multiple emails. Or could I make sure the connection is closed before opening another? The only other option is to send
2007 Jun 28
3
acts_as_ferret and capistrano
Hi, I''d like to share the ferret indexes between deployments of a Rails app. At the moment the index is stored in #{RAILS_ROOT}/index meaning that it gets moved and must be rebuilt after every deploy. I guess the simplest solution would be to put it under log/ which is already shared by capistrano, any other ideas? Also, script/ferret_stop doesn''t work when run on a fresh
2006 May 08
5
Files in LIB folder do not seem to update even in DEV mode!!
Hi When i change my classes in the LIB folder they are not updating on the server. My server is in development mode. Any ideas why? Any help is appreciated Thanks, Chris -- Posted via http://www.ruby-forum.com/.
2006 Jan 23
16
Adding form fields (extending a form) on the fly
Hello, I just can''t seem to find a way to extend a form dynamically in ROR. Say I am writing a recipe website. There is one form to enter the recipe. There is room for N number of ingredients (let''s say a text field for each ingredient name and selection list for the amount). What if the user wants to add more than N ingredients as he types them in? how do I do this without
2006 Mar 23
5
validates_dateness_of ?
Hello all. I don''t suppose some enterprising soul with much more skill than me has whipped up a "validates_dateness_of" (Complete with leap year calculations) method for use with all the other validation methods and wishes to spread much much joy? Cheers Jeff "I can barely code RoR and rely on others to do the hard work" Jones -- Posted via
2006 Feb 09
1
Alternative take on Selenium in Rails
Hey there, There''s been a bit of work going on with Selenium and Rails recently, so I thought I may as well share what I came up with. Check out my blog post at http://blog.viney.net.nz/articles/2006/02/09/selenium-testing, grab the plugin and give it a whirl (be sure to read the README!). Basically, my approach was to make it possible to write Selenium tests in the same way that
2006 Jan 19
9
start_form_tag not taking url_for options
I''ve got a form that should post to user/login. The code to start the tag is: <%= start_form_tag { :controller => "user", :action => "login" } %> That gives me this exception: compile error script/../config/../app/views/user/login.rhtml:1: parse error, unexpected tASSOC, expecting ''}'' _erbout = ''''; _erbout.concat((
2006 Jan 23
3
create and update with has_many :through
I''m using Edge Rails and the new has_many :through in my code. What I''m trying to do is modify my create and update code to use the new relationships. I''m using a table called course_teachers for the joins. Here is what I have so far: def create @course = Course.new(params[:course]) @teacher = Teacher.find(params[:primary_teacher]) @course.teachers =
2006 Feb 13
9
Selenium. Replacement for traditional rails functional test?
Hi list I''ve got a bit of a philosophical question. After just having discovered Selenium /Selenium IDE and the rails selenium plugin I''ve realized that it''s a whole lot easier to do functinoal testing than writing the traditional rails functional tests. However it implies that the development database consists of standardized test data (e.g the test & dev
2006 Mar 24
3
JS validation on a form/submit tag? Like :condition=>...
Hallo -- is there a way anyone know of that I can add a :confirm clause to a form submit? Something like: <%= submit_tag ''commit'', :confirm=>"are you certain?" %> Does anyone know how to achieve this? Cheers, doug. -- Posted via http://www.ruby-forum.com/.
2006 Apr 01
4
Custom Validations
Does anyone how to create a validation that: validates_presence_of :a OR :b I.e. :a OR :b must be present. I thought this would probably be possible with some kind of validation callback, e.g.: def check_a_or_b_is_set return (a or b) end Any ideas? Thanks, Rob -------------- next part -------------- An HTML attachment was scrubbed... URL:
2005 Dec 18
13
calculate age based on DoB
Hi, I wrote a little helper that calulates someone''s age based on his/her date of birth. def age(dob) diff = Date.today - dob age = (diff / 365.25).floor age.to_s end It works fine, but it''s not completely accurate as it just takes the average days in a year. It should be able to calculate this more accurately, right? I can''t work it out