search for: tx_scottwalt

Displaying 20 results from an estimated 27 matches for "tx_scottwalt".

Did you mean: tx_scottwalter
2006 May 08
6
how to make field in model immutable after create
Hello everyone! I want to have login field in User model which is set only once (on create), and then it should fail validation if the value is changed. How can I do this? I dig around for validation and tried def after_validation_on_update unless User.find_by_login(:login) errors.add(:login, "is immutable. You can''t change it") end end in model, but somewhat it
2005 Oct 24
3
Custom View Location
Hi, I would like to have the ability for my application''s .rhtml files to be customized after I give my app to a client. However I don''t want them to mess with the existing templates. Basically I would like to look in a directory lets say "customize" which would be off the RAILS_ROOT directory. If a .rhtml is in the "customize" there use that one, if not
2005 Oct 28
2
Accessing fixture
I have a very simple problem. I can''t seem to access a the fixture by name I have a sites.yml with: simple_site: id: 1 name: demo description: A demo site created_on: 2005-10-25 00:00:00 updated_on: 2005-10-25 00:00:00 And I have a test class as: require File.dirname(__FILE__) + ''/../test_helper'' class SiteTest < Test::Unit::TestCase fixtures
2006 Mar 28
5
Rails 1.1 for new apps only
Hi, I was very excited to hear that Rails 1.1 project has been released. It gave me the fire I need to get started on a pet project I''ve been thinking about. However I have a couple apps that don''t seem to play nice with Rails 1.1, mainly Typo. So my question is: How can I install Rails 1.1 for only a new application? thanks, scott.
2006 Feb 22
5
[OT] Apache rewrite stuff...
Hi all, a little off topic, but was wondering what the best way is to re-write incoming requests so that they all end up at the same domain. For example, if I had: my_domain.net my_domain.com my_domain.org Whats the best way to map/redirect all of these to www.my_domain.com ? I know its possible, just not sure what to add for rules/virtual hosts in my apache config. Thanks for the help! -Nick
2006 Jul 11
1
Aggregate Controllers
Hi, I''m developing a dashboard like page and basically want to combine the result of multiple actions on a page. I''ve done this so far: def index r1 = render_to_string :action => "action1" r2 = render_to_string :action => "action2" render :text => r1+r2 end This works, but now I want to render from other controllers and this is where
2006 Apr 03
3
How do I programmatically send a 404 error
I want to programmatically under certain conditions return a 404 (page not found) error to the browser. How can I do this from my controller? I''m assuming I need to set a header on the reponse obect. However I can''t figure out what the header name is. thanks, scott. -- Posted via http://www.ruby-forum.com/.
2006 Feb 11
1
Fastcgi and mysql woes
Hi, I have been heck of a time to get mysql and fastcgi to work properly on my Mac OS X box. I keep getting the following error: Can''t connect to local MySQL server through socket ''/opt/local/var/run/mysql5/mysqld.sock'' (13) I have even tried commenting out the "socket" option in my database.yml but it still gives me the same error. I''m ok when I
2006 Aug 01
1
Transactions within the Controller
Hi, I have 2 models, how can I save both of them in one transaction? I want to do something like this: begin transaction project.save person.save end transaction The only examples I''ve seen is with saving 2 instances of the same model in a transaction. thanks scott. -------------- next part -------------- An HTML attachment was scrubbed... URL:
2006 Jun 06
5
[OT] O''Reilly Cookbooks
Hi, Has anyone gotten the "roughcuts" of the Ruby and Rails cookbooks? If you have the Pragmattic Rails Cookbook is the O''Reilly worth it? Also can you download PDF''s of their "roughcuts". The website is kind of vague, it just mentions online access (whatever that means). Thanks in advance.
2006 Jun 13
0
[OT] Rico Live Grid
Hi, I was curious if anyone has implemented Rico''s Live Grid (ajaxed html tables)? Do you like it? Do your users like it? cheers, scott ---------------------------------------------------------------------------------------------------- What''s an Intel chip doing in a Mac? A whole lor more that it''s ever done in a PC. My Digital Life -
2006 Jun 20
0
Quiet the Logger in 1.1
I''m using Rails 1.1 and I''m trying to quiet the logger. I searched the mailing list and placed the following inside my environment.rb: RAILS_DEFAULT_LOGGER.level = (RAILS_ENV == ''production'' ? Logger::INFO : Logger::DEBUG) But I keep getting: /usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:123:in `const_missing'':
2006 Jun 21
1
Adding routes via plugins
Hi, I''m attempting to add a route via a plugin. I attempted to add the following to my init.rb: myroute = ActionController::Routing::Routes.connect "boo2", :controller=>''plugin'', :action=>''index'' puts "path=#{myroute.path}" myroute.options.keys.each do |k| puts "#{k}=#{myroute.options[k]}" end The newly
2006 Jun 23
1
@request.env and mongrel
Hi, I don''t know if this question should be posted here on the Rails list or the Mongrel list, but I''ll try here first. I had been using Aapache+FCGI and when I run the following code from my server''s domain "perficient.com" it returns "perficient.com:80": port = @request.env["SERVER_PORT"]==''80'' ? '''' :
2006 Apr 02
0
sqlonrails.org april fools joke
Did anyone see the http://www.sqlonrails.org/ April Fools joke website? Its hilarious. Watch the screencast. scott. -- Posted via http://www.ruby-forum.com/.
2006 Apr 04
1
subdomain routing
According to the wiki (http://wiki.rubyonrails.org/rails/pages/Routes) you can handle subdomain routing in routes.rb. Like this: with_options :requirements=>{:subdomain=>''first.com''} do map.connect '''', :controller => "first/catalog" map.connect ''featured'', :controller => "first/catalog",
2006 Apr 05
0
apache and subdomains
Hi, I''m trying to get a subdomain to map to a controller. For example: blog.domain.com to point to /list so in my virtual host I tried: RewriteEngine On RewriteCond %{HTTP_HOST} ^blog.localhost$ RewriteCond %{REQUEST_URI} !^/blog/ RewriteRule ^(.*)$ /blog/$1 but it just goes to the root of my rails app. any ideas? scott.
2006 Apr 07
0
acts_as_taggable and tag list
Hi, I''m using the new acts_as_taggable on Rails 1.1.1. I would like to get a list of all the tags for a particular model type, in my case "Post". I got it to work with: Tag.find(:all,:include => :taggings, :conditions => "taggable_type=''Chunk''") But I''m wondering if there''s a more Rubyish elegant way. thanks, scott.
2006 Apr 07
1
Acts_as_Taggable
A couple of quick acts_as_taggable (the Rails 1.1 plugin version) 1. Can you update tags on an existing record? If I execute the tag_with statement twice it creates two rows in the taggings column, instead of updating the value of the existing tag 2. Can you delete tags? I didn''t see a method for this. If I can delete tags, problem #1 goes away. scott.
2006 Feb 15
1
Per Database Migrations
Is there away to have parts of a migration file only work with a specific database. For example I am inserting some data into a table with: execute "INSERT INTO demo_lists(position, name, updated_at, created_at) VALUES (1, 1, ''scott'', CURDATE(), CURDATE());" Of course the curdate() function may only be available on mysql. So can we some how determine which