search for: spreydon

Displaying 16 results from an estimated 16 matches for "spreydon".

2006 Jan 25
9
AJAX Search w/database results
Hey, I have a main page that lists a table of Devices, along with a Search box. I''d like to have the Search field pull up any related Devices, and then re-populate the table. I can do this without AJAX, just calling my List action over again, passing the params to search on, but with AJAX I get the error, "Cannot convert nil to string" on this line: @device_pages, @devices =
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 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 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 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 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
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 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((
2007 Sep 13
7
Namespacing Models
Hello everyone, Do you feel it? The little shiver down your spine when you think of "namespacing" in rails? To some thats a common feeling, to people like myself who enforce absolute organization have already thought about the need for namespaces in rails. Now I do understand this is an ongoing effort... to some degree. Controllers and routes, from my experiences work well, that being,
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 Feb 14
4
Fine grained access control
Hi, I''m building an application which is going to require quite fine grained access control. Deciding if a user is allowed to access an action will probably require checking quite number of different rules, so a simple role-based system won''t be flexible enough. The approach I think I will try first is, if it''s possible, to ignore permission issues inside the
2006 Feb 19
0
Selenium testing plugin
Greetings, I''ve just finished a new release of my Selenium testing plugin with much tighter integration to rails. The rake selenium step has been removed as all tests are now live (just save your test file and refresh the browser). Install it with: script/plugin install http://svn.viney.net.nz/things/rails/plugins/selenium_testing And check out the readme:
2006 Jan 19
0
Input date in different format
Hey there, I would like to be able to enter dates in a few different formats. As well as the standard 2006-01-01 format I want to be able to enter it in m/d/yy format (eg 1/1/06 for 2006-01-01), and d mmm yy (eg 1 Jan 06). What''s the simplest way to do this? I had a go at changing ActiveRecord::ConnectionAdapters::Column.string_to_date, and that *seems* to work, but I''m not