[Rails] nginx deployment
Hi, I have deployed my rails application using nginx module. It is running successfully but my problem is whenever I am restart/start the server I am getting following warning [warn]: conflicting server name localhost on 0.0.0.0:3000, ignored My nginx.conf file is as follows:- #user nobody; worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pidlogs/nginx.pid; events { worker_connections 1024; } http { passenger_root /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.15; passenger_ruby /usr/local/bin/ruby; include mime.types; default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] $request ' # '$status $body_bytes_sent $http_referer ' # '$http_user_agent $http_x_forwarded_for'; #access_log logs/access.log main; sendfileon; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; server { listen 3000; server_name localhost; root /home/rails_project/find_my_home_demo/public; # --- be sure to point to 'public'! passenger_enabled on; passenger_use_global_queue on; } server { listen 3000; server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / { root html; index index.html index.htm; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { #proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # #location ~ \.php$ { #root html; #fastcgi_pass 127.0.0.1:9000; #fastcgi_index index.php; #fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; #includefastcgi_params; #} # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { #deny all; #} } # another virtual host using mix of IP-, name-, and port-based configuration # #server { #listen 8000; #listen somename:8080; #server_name somename alias another.alias; #location / { #root html; #index index.html index.htm; #} #} # HTTPS server # #server { #listen 443; #server_name localhost; #ssl on; #ssl_certificate cert.pem; #ssl_certificate_key cert.key; #ssl_session_timeout 5m; #ssl_protocols SSLv2 SSLv3 TLSv1; #ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP; #ssl_prefer_server_ciphers on; #location / { #root html; #index index.html index.htm; #} #} } Can anyone tell me how to solve this? Thanks, Tushar -- Posted via http://www.ruby-forum.com/. -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] nginx deployment
Hi, You have 2 servers to listen on the port 3000 in the config, thats the problem imo -- Thanks Regards, Dhruva Sagar. On Tue, Oct 26, 2010 at 11:35, Tushar Gandhi li...@ruby-forum.com wrote: Hi, I have deployed my rails application using nginx module. It is running successfully but my problem is whenever I am restart/start the server I am getting following warning [warn]: conflicting server name localhost on 0.0.0.0:3000, ignored My nginx.conf file is as follows:- #user nobody; worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pidlogs/nginx.pid; events { worker_connections 1024; } http { passenger_root /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.15; passenger_ruby /usr/local/bin/ruby; include mime.types; default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] $request ' # '$status $body_bytes_sent $http_referer ' # '$http_user_agent $http_x_forwarded_for'; #access_log logs/access.log main; sendfileon; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; server { listen 3000; server_name localhost; root /home/rails_project/find_my_home_demo/public; # --- be sure to point to 'public'! passenger_enabled on; passenger_use_global_queue on; } server { listen 3000; server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / { root html; index index.html index.htm; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { #proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # #location ~ \.php$ { #root html; #fastcgi_pass 127.0.0.1:9000; #fastcgi_index index.php; #fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; #includefastcgi_params; #} # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { #deny all; #} } # another virtual host using mix of IP-, name-, and port-based configuration # #server { #listen 8000; #listen somename:8080; #server_name somename alias another.alias; #location / { #root html; #index index.html index.htm; #} #} # HTTPS server # #server { #listen 443; #server_name localhost; #ssl on; #ssl_certificate cert.pem; #ssl_certificate_key cert.key; #ssl_session_timeout 5m; #ssl_protocols SSLv2 SSLv3 TLSv1; #ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP; #ssl_prefer_server_ciphers on; #location / { #root html; #index index.html index.htm; #} #} } Can anyone tell me how to solve this? Thanks, Tushar -- Posted via http://www.ruby-forum.com/. -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.comrubyonrails-talk%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] nginx deployment
Hi, As you can see, the second server to listen on 3000 has been given the server_name localhost. Nginx is ignoring that config since it can't listen on the same port twice. -- Thanks Regards, Dhruva Sagar. On Tue, Oct 26, 2010 at 11:38, Dhruva Sagar dhruva.sa...@gmail.com wrote: Hi, You have 2 servers to listen on the port 3000 in the config, thats the problem imo -- Thanks Regards, Dhruva Sagar. On Tue, Oct 26, 2010 at 11:35, Tushar Gandhi li...@ruby-forum.com wrote: Hi, I have deployed my rails application using nginx module. It is running successfully but my problem is whenever I am restart/start the server I am getting following warning [warn]: conflicting server name localhost on 0.0.0.0:3000, ignored My nginx.conf file is as follows:- #user nobody; worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pidlogs/nginx.pid; events { worker_connections 1024; } http { passenger_root /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.15; passenger_ruby /usr/local/bin/ruby; include mime.types; default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] $request ' # '$status $body_bytes_sent $http_referer ' # '$http_user_agent $http_x_forwarded_for'; #access_log logs/access.log main; sendfileon; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; server { listen 3000; server_name localhost; root /home/rails_project/find_my_home_demo/public; # --- be sure to point to 'public'! passenger_enabled on; passenger_use_global_queue on; } server { listen 3000; server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / { root html; index index.html index.htm; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { #proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # #location ~ \.php$ { #root html; #fastcgi_pass 127.0.0.1:9000; #fastcgi_index index.php; #fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; #includefastcgi_params; #} # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { #deny all; #} } # another virtual host using mix of IP-, name-, and port-based configuration # #server { #listen 8000; #listen somename:8080; #server_name somename alias another.alias; #location / { #root html; #index index.html index.htm; #} #} # HTTPS server # #server { #listen 443; #server_name localhost; #ssl on; #ssl_certificate cert.pem; #ssl_certificate_key cert.key; #ssl_session_timeout 5m; #ssl_protocols SSLv2 SSLv3 TLSv1; #ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP; #ssl_prefer_server_ciphers on; #location / { #root html; #index index.html index.htm; #} #} } Can anyone tell me how to solve this? Thanks, Tushar -- Posted via http://www.ruby-forum.com/. -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.comrubyonrails-talk%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: multiple domain names mapping to different rails app URLs
Now I'm firmly back in the rails world here, any kind soul give me a pointer as to how I might finish this one. I figure I need to modify the routes file and perhaps conditionally modify the rails app home root based on domain - what else? -- Posted via http://www.ruby-forum.com/. -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] Re: multiple domain names mapping to different rails app URLs
I think you should run different rail apps on different ports and use Nginx to proxy to them. That should be simple enough. -- Thanks Regards, Dhruva Sagar. On Tue, Oct 26, 2010 at 11:57, bingo bob li...@ruby-forum.com wrote: Now I'm firmly back in the rails world here, any kind soul give me a pointer as to how I might finish this one. I figure I need to modify the routes file and perhaps conditionally modify the rails app home root based on domain - what else? -- Posted via http://www.ruby-forum.com/. -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.comrubyonrails-talk%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: multiple domain names mapping to different rails app URLs
Multiple apps is definitely not what I wish to do here. It's a single app. -- Posted via http://www.ruby-forum.com/. -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] Re: multiple domain names mapping to different rails app URLs
Oh well if that is the case then you can probably check the current domain / request.url in a before_filter inside application_controller and work accordingly thereafter, that should be simple enough too... -- Thanks Regards, Dhruva Sagar. On Tue, Oct 26, 2010 at 12:32, bingo bob li...@ruby-forum.com wrote: Multiple apps is definitely not what I wish to do here. It's a single app. -- Posted via http://www.ruby-forum.com/. -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.comrubyonrails-talk%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: multiple domain names mapping to different rails app URLs
A quick look and the following points: - you are not scoping your property_id to the domain. If you go to http://chaletcordee.co.uk/properties/1 you can change to properties 2 in the domain controller and you pick up the other property. Your application controller should set an instance variable for the request @property which you should always use as the parent of all subsequent request in a before filter. I think you said you implemented this. App controller... before_filter :domain_lookup private def domain_lookup @domain = Domain.find_by_host(request.host) # raises errors when necessary end - apache is doing some redirects here. You shouldn't need any other than the no-www stuff. Take them out. Let rails do the routing. You only really need mod_rewrite if you are doing URL rewriting which I don't think you need. - your map.root invokes your welcome controller. This should work if the welcome controller index action shows the details of the property you have sitting in your instance variable @property Sounds like you are almost there. O. On Oct 26, 7:27 am, bingo bob li...@ruby-forum.com wrote: Now I'm firmly back in the rails world here, any kind soul give me a pointer as to how I might finish this one. I figure I need to modify the routes file and perhaps conditionally modify the rails app home root based on domain - what else? -- Posted viahttp://www.ruby-forum.com/. -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] Re: Re: Forcing rails to output HTML4 rather then XHTML?
On 25 Oct 2010, at 17:34, Marnen Laibow-Koser wrote: Not perfectly, perhaps, but as well as possible. I am not sure that providing HTML 5 markup meets that goal. However, I haven't yet done much research about older browsers' support of HTML 5. I think the poster meant something like: I use some of the newer CSS features and maybe some HTML5 attributes. Older browsers will simply ignore those and move on. ...or not. Yes, of course it's fine to use new attributes that older browsers will ignore. However, HTML 5 differs from HTML 4 not just in its repertoire of attributes and elements, but also *in its basic syntax* -- HTML 5 is no longer a subset of SGML as HTML ≤4 is. That's the part that (potentially) breaks graceful degradation. Uhu, completely agree. But I've noticed a lot of people are throwing around HTML5 these days like Web 2.0 in the recent past. The major difference being that HTML5 actually isn't an empty shell like Web 2.0 was, but actually has a more-or-less well defined meaning. Anyway, back to the HTML4 rather than XHTML, which has little to do with HTML5 anyway. IE6 perfectly supports XHTML and its br / tags (with all of the usual IE6 quirks of course), so there is no reason to go to HTML4 if that is your concern. Best regards Peter De Berdt -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] Re: Re: Forcing rails to output HTML4 rather then XHTML?
...or not. Yes, of course it's fine to use new attributes that older browsers will ignore. However, HTML 5 differs from HTML 4 not just in its repertoire of attributes and elements, but also *in its basic syntax* -- HTML 5 is no longer a subset of SGML as HTML ≤4 is. That's he part that (potentially) breaks graceful degradation. It breaks absolutely nothing. More than that, only because browsers don't give a damn about SGML rules all that XHTML nonsense was possible: according to SGML br / should be rendered as if it was br gt; (search for SGML SHORTTAG). Anyway, back to the HTML4 rather than XHTML, which has little to do with HTML5 anyway. IE6 perfectly supports XHTML and its br / tags (with all of the usual IE6 quirks of course), so there is no reason to go to HTML4 if that is your concern. IE6 (and any version of IE) does not support XHTML at all. Try to feed them proper XHTML (that's with the MIME type application/xhtml+xml) and see what happens. They just silently ignore all those slashes. HTML5 finally fixes this, and you can use a syntax you like for your HTML5 documents. However, if you want XHTML5 you MUST server your document with application/xhtml+xml: and by doing so be aware of all the differences in behaviour this brings. Regards, Rimantas -- http://rimantas.com/ -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Create super-simple adding application
On Oct 26, 3:18 am, debalmoto debalm...@gmail.com wrote: Ok, so I figured out what was causing the error, I wasnt calling params[:number_one] in the right place. Fixing this took care of the error. Now I can call them in my controller like so: @a = params[:number_one].to_i @b = params[:number_one].to_i @sum = @a + @b But when I put numbers in my text boxes, it always shows 0. I even put this is my view: p%= params[:number_one].to_i + params[:number_two].to_i %/p And it also always shows 0. What am I doing wrong? I'd check the development.log file to see what parameters are actually getting submitted. Fred -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Validating model depending on controller action
Hi, I have a custom validation in my model, reviewing the content of some field. This field indicates that the record is closed, so it can not be modified. The only way to reopen the record is by executing an specific model action: reopen. So my question is: how can I avoid to validate this field JUST for the controller reopen action? Thanks in advance -- Posted via http://www.ruby-forum.com/. -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Trubelshooting MS Sql database connection
Hello i have been atempting to move a project from sqlite database to a sql server database with absolutly no success. i am now going to document my entire process so that mabey someone can se the error of my ways. And if some one else has this problem this migth act as a troubleshooting guide. OS: windows server 2003 latest sp Sql: Sql server 2008 1. Install ruby 192.p0 from http://rubyinstaller.com/downloads (ticked both boxes ie add to PATH and associate files) installation folder is c:/ruby192 2.Install rails via gem install rails 3. Install mongrel via gem install mongrel --pre 4. install the sql adapter via gem install activerecord-swlserver-adapter 5. install dbd-odbc via gem install dbd-odbc this also installed the dbi gem so i wont install this from a separate command Ok now everything i need to start RoR with mongrel and Sql Server should be installed as far as i know on to the gem file gem 'rails'#, '3.0.1' require 'activerecord-sqlserver-adapter' gem 'mongrel', '1.2.0.pre2' require 'dbi' and then the database.yml development: adapter: sqlserver mode: odbc database: NameOfMyDB host: localhost dsn: name_of_my_db autocommit: true username: something password: something Notes about this conf dsn is the same name as the dsn i created with the odbc data source administrator tool this is a system DSN by the way i have also tried with file DSN Ok now on to running my app i go to the directory wich is located as follows D:/projects/railsdev/projectname/ so i go there and execute bundle install the result of this is Error require: no such file to load --activerecord-sqlserver-adapter if i change my require to a gem command everything is installed and the server starts when i try to connect to the database i get another error LoadError (no such file to load --odbc) i have been loosing sleep over this please tell me what am i doing wrong ? -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] AssociationTypeMismatch
I have a very simple pairing scenario that links a pair to two items (cross-comparison and rating). My problem is that on insertion of the pair I get an AssociationTypeMismatch error, that I haven't seen before. class Pair ActiveRecord::Base has_one :flag has_one :item_1, :class_name = 'Item' has_one :item_2, :class_name = 'Item' end class Flag ActiveRecord::Base belongs_to :pair has_many :pairs validates_presence_of :descriptor, :weight end The Item class is very simple. What am I missing or doing wrong on trying to create the new pair? pair = Pair.new(:item_1 = 606276291, :item_2 = 92386) ActiveRecord::AssociationTypeMismatch: Item(#70065549615160) expected, got Fixnum(#70065601288820) Thanks. -- Posted via http://www.ruby-forum.com/. -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Validating model depending on controller action
On Oct 26, 9:36 am, Alfredo Bonilla li...@ruby-forum.com wrote: Hi, I have a custom validation in my model, reviewing the content of some field. This field indicates that the record is closed, so it can not be modified. The only way to reopen the record is by executing an specific model action: reopen. So my question is: how can I avoid to validate this field JUST for the controller reopen action? Models (quite rightly) have no concept of controller actions. If you want to do this then you have to change some of the model's state (eg set an instance variable) when reopen is called and check that in your validation. A validation doesn't feel quite right to me. While it sounds like you can probably do what you want it sounds like you are stretching the semantics slightly: it's not that a particular combination of attributes that are invalid, it's a set of transitions that are invalid. I'd be more inclined to write a before_validation callback Fred -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: multiple domain names mapping to different rails app URLs
Inline - I won't have a chance to test this out until a little later but yes - thanks for this, think I'm getting it. Owain wrote in post #957124: A quick look and the following points: - you are not scoping your property_id to the domain. If you go to http://chaletcordee.co.uk/properties/1 you can change to properties 2 in the domain controller and you pick up the other property. Your application controller should set an instance variable for the request @property which you should always use as the parent of all subsequent request in a before filter. I think you said you implemented this. App controller... before_filter :domain_lookup private def domain_lookup @domain = Domain.find_by_host(request.host) # raises errors when necessary end So if I've understood you correctly, I'd do something like this...something like I mean - just to see if this is on the right lines? App controller... before_filter :domain_lookup private def domain_lookup @domain = Domain.find_by_host(request.host) # raises errors when necessary # New step find the property and set the instance variable, # do something else sensible if there's a problem if @domain # guess the line below is the key # set a property instance via the domain name @property = @domain.property else # do stuff if there's no domain... end properties controller at present I find properties by ID - but with this new method I wouldn't need to do that, it's already done in the app controller. should be easy. routes this is where I possibly need most advice. http://pastie.org/1230080 at present these lines... map.photos 'properties/:id/photos', :controller = 'properties', :action = 'photos' map.contacts 'properties/:id/contacts', :controller = 'properties', :action = 'contacts' get me to the various pages, but I do not want the /properties/id bit in the URL, how do I redo this routing without /properties/id showing... is it simply? map.contacts '/contacts', :controller = 'properties', :action = 'contacts' - apache is doing some redirects here. You shouldn't need any other than the no-www stuff. Take them out. Let rails do the routing. You only really need mod_rewrite if you are doing URL rewriting which I don't think you need. OK - I thought I just had the no-www stuff in there - but ok. - your map.root invokes your welcome controller. This should work if the welcome controller index action shows the details of the property you have sitting in your instance variable @property I'll have to think of a sensible place to point map.root, one this is a front page for the app which isn't a particular property at all - or I might send it to one of the properties - haven't registered a domain name for it yet. Sounds like you are almost there. I think so ! :-). O. -- Posted via http://www.ruby-forum.com/. -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Problems when connecting to Sql server 2008 odbc no such file to load error
Windows server 2003 the app was originally developed on OSX snow leopard using just sqlite3 and i sucessluffy migrated it and got it running without a hitch on win server 2003 but i have to get it working with SQL sever 2008 for production purposes (sqlite3 just wont cut it) On 25 Okt, 17:37, radhames brito rbri...@gmail.com wrote: @Fredrik TiC Jansson What os are you running your dev on? -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Validating model depending on controller action
Frederick Cheung wrote in post #957145: On Oct 26, 9:36am, Alfredo Bonilla li...@ruby-forum.com wrote: controller reopen action? Models (quite rightly) have no concept of controller actions. If you want to do this then you have to change some of the model's state (eg set an instance variable) when reopen is called and check that in your validation. A validation doesn't feel quite right to me. While it sounds like you can probably do what you want it sounds like you are stretching the semantics slightly: it's not that a particular combination of attributes that are invalid, it's a set of transitions that are invalid. I'd be more inclined to write a before_validation callback Fred Thanks for your answer. I would use the instance variable, but if my code in the model looks like: validate :minutes_editable ... def minutes_editable if minutes_closed_was errors.add(:minutes_closed, specifies that the board is closed. To reopen, use contextual menu action.) end end where minutes_closed is the boolean field that just can be passed from true to false by executing the reopen action. How would you use the before_validation callback? -- Posted via http://www.ruby-forum.com/. -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Need LAMP Development Lead: Location: New Delhi: Exp: 5+ Yrs exp..
Hey All, I need a LAMP development lead for one of my clients. Please email me at arudr...@gmail.com or call me at +91-9811140115 for detailed Job Description and client details.. Regards, Arudreya Thapliyal -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Validating model depending on controller action
On Oct 26, 10:21 am, Alfredo Bonilla li...@ruby-forum.com wrote: Thanks for your answer. I would use the instance variable, but if my code in the model looks like: validate :minutes_editable ... def minutes_editable if minutes_closed_was errors.add(:minutes_closed, specifies that the board is closed. To reopen, use contextual menu action.) end end where minutes_closed is the boolean field that just can be passed from true to false by executing the reopen action. Sorry not sure what you're asking now How would you use the before_validation callback? It would be pretty much the same except that instead of adding an error I'd raise some appropriate exception. Fred -- Posted viahttp://www.ruby-forum.com/. -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Validating model depending on controller action
Frederick Cheung wrote in post #957158: On Oct 26, 10:21am, Alfredo Bonilla li...@ruby-forum.com wrote: end end where minutes_closed is the boolean field that just can be passed from true to false by executing the reopen action. Sorry not sure what you're asking now How would you use the before_validation callback? It would be pretty much the same except that instead of adding an error I'd raise some appropriate exception. Fred Sorry about this, but... if I raise an exception... the update would be cancelled in both cases (coming from regular update or from this reopen action). I have to allow the second way (coming from reopen) -- Posted via http://www.ruby-forum.com/. -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: AssociationTypeMismatch
class Pair ActiveRecord::Base belongs_to :flag belongs_to :item, :class_name = 'Item', :foreign_key = 'item_1', :validate = true belongs_to :item, :class_name = 'Item', :foreign_key = 'item_2', :validate = true end seems to fix the problem. -- Posted via http://www.ruby-forum.com/. -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: AssociationTypeMismatch
On Oct 26, 9:43 am, Sem Ptiri li...@ruby-forum.com wrote: What am I missing or doing wrong on trying to create the new pair? pair = Pair.new(:item_1 = 606276291, :item_2 = 92386) ActiveRecord::AssociationTypeMismatch: Item(#70065549615160) expected, got Fixnum(#70065601288820) It's expecting an instance of item, but you're giving it an integer instead. Fred Thanks. -- Posted viahttp://www.ruby-forum.com/. -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] Trubelshooting MS Sql database connection
On Tue, Oct 26, 2010 at 5:41 AM, Fredrik TiC Jansson fredrikjansson1...@gmail.com wrote: Hello i have been atempting to move a project from sqlite database to a sql server database with absolutly no success. i am now going to document my entire process so that mabey someone can se the error of my ways. And if some one else has this problem this migth act as a troubleshooting guide. OS: windows server 2003 latest sp Sql: Sql server 2008 1. Install ruby 192.p0 from http://rubyinstaller.com/downloads (ticked both boxes ie add to PATH and associate files) installation folder is c:/ruby192 2.Install rails via gem install rails 3. Install mongrel via gem install mongrel --pre 4. install the sql adapter via gem install activerecord-swlserver-adapter 5. install dbd-odbc via gem install dbd-odbc this also installed the dbi gem so i wont install this from a separate command Ok now everything i need to start RoR with mongrel and Sql Server should be installed as far as i know on to the gem file gem 'rails'#, '3.0.1' require 'activerecord-sqlserver-adapter' gem 'mongrel', '1.2.0.pre2' require 'dbi' and then the database.yml development: adapter: sqlserver mode: odbc database: NameOfMyDB host: localhost dsn: name_of_my_db autocommit: true username: something password: something Notes about this conf dsn is the same name as the dsn i created with the odbc data source administrator tool this is a system DSN by the way i have also tried with file DSN Ok now on to running my app i go to the directory wich is located as follows D:/projects/railsdev/projectname/ so i go there and execute bundle install the result of this is Error require: no such file to load --activerecord-sqlserver-adapter if i change my require to a gem command everything is installed and the server starts when i try to connect to the database i get another error LoadError (no such file to load --odbc) i have been loosing sleep over this please tell me what am i doing wrong ? -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.comrubyonrails-talk%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. take a look at http://www.10pines.com/content/deploy-ruby-rails-windows-2008-server-and-iis-70 greets -- http://www.rodolinux.com.ar I must not fear. Fear is the mind-killer. I will face my fear. I will permit it to pass over me and through me. And when it has gone past I will turn the inner eye to see its path. Where the fear has gone there will be nothing. Only I will remain. - Bene Geserit's Fear Lethany - Dune Trilogy - Frank Herbert -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] [JOBS] Ruby on Rails developer needed
We are a small, hard-working company looking for a great developer who can help us out with our current and future projects. We are using Ruby (v1.8.7 - v1.9.2) and Rails (v2.3.8 - v3.0.1) for our internal and external applications. You must have experience in working professionally using Ruby and Ruby on Rails and be able to demonstrate your experience. We expect high quality work and this includes comprehensive test coverage. You can work from home but we need to meet up at least once a week at our offices in Leeds, UK. This will be a contract position for a minimum of 3 months with possible extension and immediate start. Please email me at tom.garb...@masta.org if you would like to come for an interview, no agencies please. -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Unable to rrun script/console for newly created project
Hello Rails community, I create a new project with rails 2.x.y. rails micro_project Then cd micro_project An then I try to enter into console: script/console and rails throws following ugly error: /home/eugenc/.rvm/gems/ruby-1.9.2...@rails238/gems/actionmailer-2.3.8/lib/action_mailer.rb:52:in `top (required)': Text is not a module (TypeError) from internal:lib/rubygems/custom_require:29:in `require' from internal:lib/rubygems/custom_require:29:in `require' from /home/eugenc/.rvm/gems/ruby-1.9.2...@rails238/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `block in require' from /home/eugenc/.rvm/gems/ruby-1.9.2...@rails238/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in `new_constants_in' from /home/eugenc/.rvm/gems/ruby-1.9.2...@rails238/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require' from /home/eugenc/.rvm/gems/ruby-1.9.2...@rails238/gems/rails-2.3.8/lib/initializer.rb:268:in `block in require_frameworks' from /home/eugenc/.rvm/gems/ruby-1.9.2...@rails238/gems/rails-2.3.8/lib/initializer.rb:268:in `each' from /home/eugenc/.rvm/gems/ruby-1.9.2...@rails238/gems/rails-2.3.8/lib/initializer.rb:268:in `require_frameworks' from /home/eugenc/.rvm/gems/ruby-1.9.2...@rails238/gems/rails-2.3.8/lib/initializer.rb:134:in `process' from /home/eugenc/.rvm/gems/ruby-1.9.2...@rails238/gems/rails-2.3.8/lib/initializer.rb:113:in `run' from /home/eugenc/Dropbox/lab/sandbox/micro_project/config/environment.rb:9:in `top (required)' from internal:lib/rubygems/custom_require:29:in `require' from internal:lib/rubygems/custom_require:29:in `require' from /home/eugenc/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/irb/init.rb:281:in `block in load_modules' from /home/eugenc/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/irb/init.rb:279:in `each' from /home/eugenc/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/irb/init.rb:279:in `load_modules' from /home/eugenc/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/irb/init.rb:20:in `setup' from /home/eugenc/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/irb.rb:53:in `start' from /home/eugenc/.rvm/rubies/ruby-1.9.2-p0/bin/irb:17:in `main' I have tried lot of combinations of version with rvm and gemsets: ruby 1.8.7, rails 2.3.5 then ruby 1.8.7 2.3.8 and again I repeted process for ruby 1.9.2 and every time I got an error when I want to enter into script/console in newly created project with respective rails version. For example: rvm 1@rails235 rails -v Rails 2.3.5 rails cat_project_235 cd cat_project_235/ cat_project_235$ script/console Loading development environment (Rails 2.3.5) /home/eugenc/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:89:in `read':TypeError: can't convert Hash into Integer /home/eugenc/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:89:in `read':TypeError: can't convert Hash into Integer /home/eugenc/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:89:in `read':TypeError: can't convert Hash into Integer ruby-1.8.7-p302 This time I got console prompt by as you see, another anoying error. Another example with ruby 1.8.7 and newly installed rails 2.3.8 and newly created project in rails 2.3.8 rvm gemset create rails238 info: Gemset 'rails238' created. rvm 1@rails238 gem install rails -v 2.3.8 --no-rdoc --no-ri Successfully installed activesupport-2.3.8 Successfully installed activerecord-2.3.8 Successfully installed rack-1.1.0 Successfully installed actionpack-2.3.8 Successfully installed actionmailer-2.3.8 Successfully installed activeresource-2.3.8 Successfully installed rails-2.3.8 7 gems installed rails cat_project_238 cd cat_project_238 script/server = Booting WEBrick = Rails 2.3.8 application starting on http://0.0.0.0:3000 = Call with -d to detach = Ctrl-C to shutdown server [2010-10-26 14:28:05] INFO WEBrick 1.3.1 [2010-10-26 14:28:05] INFO ruby 1.8.7 (2010-08-16) [i686-linux] ^CExiting script/console Loading development environment (Rails 2.3.8) /home/eugenc/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:89:in `read':TypeError: can't convert Hash into Integer /home/eugenc/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:89:in `read':TypeError: can't convert Hash into Integer /home/eugenc/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:89:in `read':TypeError: can't convert Hash into Integer ruby-1.8.7-p302 As you can see - server starts ok, but script/console again same error... If I leave rvm and use system default ruby with: script/about About your application's environment Ruby version 1.8.7 (i486-linux) RubyGems version 1.3.5 Rack version 1.0 Rails version 2.3.5 Active Record version 2.3.5 Active Resource version
[Rails] rake gems:install without rdoc documentation
Hello ruby community, By default when I run rake gems:install rake install missing gems altogether with rdoc documentation. Manually I can install gems without rdoc documentation like this: gem install factory_girl --no-rdoc --no-ri How can I configure (rake? rails?or maybe gem pkg manager?) to install missing gems with two above options ? Thank you! -- Posted via http://www.ruby-forum.com/. -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] Re: Validating model depending on controller action
I do something similar, but you only need to remove it from mass assignment controller @thing = Thing.new(params[:thing]) @thing.value = enchilada model attr_accessible :name, :description = value cant be mass_assigned since is done programatically there is no need to validate it even better create a class method in the model that raises an exception if it fails and call instead of the save method, in it set the value you want : ) def selft.supersave! do the stuff or raise Exception.new(OMG LOL) end -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Trubelshooting MS Sql database connection
Thanks seems rather comprehensive i will go through your tutorial. On 26 Okt, 13:18, Rodolinux rodoli...@gmail.com wrote: On Tue, Oct 26, 2010 at 5:41 AM, Fredrik TiC Jansson fredrikjansson1...@gmail.com wrote: Hello i have been atempting to move a project from sqlite database to a sql server database with absolutly no success. i am now going to document my entire process so that mabey someone can se the error of my ways. And if some one else has this problem this migth act as a troubleshooting guide. OS: windows server 2003 latest sp Sql: Sql server 2008 1. Install ruby 192.p0 fromhttp://rubyinstaller.com/downloads(ticked both boxes ie add to PATH and associate files) installation folder is c:/ruby192 2.Install rails via gem install rails 3. Install mongrel via gem install mongrel --pre 4. install the sql adapter via gem install activerecord-swlserver-adapter 5. install dbd-odbc via gem install dbd-odbc this also installed the dbi gem so i wont install this from a separate command Ok now everything i need to start RoR with mongrel and Sql Server should be installed as far as i know on to the gem file gem 'rails'#, '3.0.1' require 'activerecord-sqlserver-adapter' gem 'mongrel', '1.2.0.pre2' require 'dbi' and then the database.yml development: adapter: sqlserver mode: odbc database: NameOfMyDB host: localhost dsn: name_of_my_db autocommit: true username: something password: something Notes about this conf dsn is the same name as the dsn i created with the odbc data source administrator tool this is a system DSN by the way i have also tried with file DSN Ok now on to running my app i go to the directory wich is located as follows D:/projects/railsdev/projectname/ so i go there and execute bundle install the result of this is Error require: no such file to load --activerecord-sqlserver-adapter if i change my require to a gem command everything is installed and the server starts when i try to connect to the database i get another error LoadError (no such file to load --odbc) i have been loosing sleep over this please tell me what am i doing wrong ? -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.comrubyonrails-talk%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. take a look athttp://www.10pines.com/content/deploy-ruby-rails-windows-2008-server-... greets --http://www.rodolinux.com.ar I must not fear. Fear is the mind-killer. I will face my fear. I will permit it to pass over me and through me. And when it has gone past I will turn the inner eye to see its path. Where the fear has gone there will be nothing. Only I will remain. - Bene Geserit's Fear Lethany - Dune Trilogy - Frank Herbert -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Problems when connecting to Sql server 2008 odbc no such file to load error
Thinking this was just a windows problem was wrong ! i am apperently doing something really really wrong. i cant seem to get any gem besides rails to install properly ! installing mongrel works but installing dbd-odbc,dbi,activerecord-sqlserver-adatper and trying to use it always gives the no such file to load -- odcb error ! i have had som other errors which where solved by manually moving the files to the ruby appears to be looking for them but i am suspecting this is not the way to do it. On 26 Okt, 11:00, Fredrik TiC Jansson fredrikjansson1...@gmail.com wrote: Windows server 2003 the app was originally developed on OSX snow leopard using just sqlite3 and i sucessluffy migrated it and got it running without a hitch on win server 2003 but i have to get it working with SQL sever 2008 for production purposes (sqlite3 just wont cut it) On 25 Okt, 17:37, radhames brito rbri...@gmail.com wrote: @Fredrik TiC Jansson What os are you running your dev on? -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] Re: Trubelshooting MS Sql database connection
It's not my tutorial. Just I found it some days ago On Tue, Oct 26, 2010 at 9:41 AM, Fredrik TiC Jansson fredrikjansson1...@gmail.com wrote: Thanks seems rather comprehensive i will go through your tutorial. On 26 Okt, 13:18, Rodolinux rodoli...@gmail.com wrote: On Tue, Oct 26, 2010 at 5:41 AM, Fredrik TiC Jansson fredrikjansson1...@gmail.com wrote: Hello i have been atempting to move a project from sqlite database to a sql server database with absolutly no success. i am now going to document my entire process so that mabey someone can se the error of my ways. And if some one else has this problem this migth act as a troubleshooting guide. OS: windows server 2003 latest sp Sql: Sql server 2008 1. Install ruby 192.p0 fromhttp://rubyinstaller.com/downloads(ticked both boxes ie add to PATH and associate files) installation folder is c:/ruby192 2.Install rails via gem install rails 3. Install mongrel via gem install mongrel --pre 4. install the sql adapter via gem install activerecord-swlserver-adapter 5. install dbd-odbc via gem install dbd-odbc this also installed the dbi gem so i wont install this from a separate command Ok now everything i need to start RoR with mongrel and Sql Server should be installed as far as i know on to the gem file gem 'rails'#, '3.0.1' require 'activerecord-sqlserver-adapter' gem 'mongrel', '1.2.0.pre2' require 'dbi' and then the database.yml development: adapter: sqlserver mode: odbc database: NameOfMyDB host: localhost dsn: name_of_my_db autocommit: true username: something password: something Notes about this conf dsn is the same name as the dsn i created with the odbc data source administrator tool this is a system DSN by the way i have also tried with file DSN Ok now on to running my app i go to the directory wich is located as follows D:/projects/railsdev/projectname/ so i go there and execute bundle install the result of this is Error require: no such file to load --activerecord-sqlserver-adapter if i change my require to a gem command everything is installed and the server starts when i try to connect to the database i get another error LoadError (no such file to load --odbc) i have been loosing sleep over this please tell me what am i doing wrong ? -- 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 rubyonrails-talk@googlegroups.com . To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.comrubyonrails-talk%2bunsubscr...@googlegroups.com rubyonrails-talk%2bunsubscr...@googlegroups.comrubyonrails-talk%252bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. take a look athttp:// www.10pines.com/content/deploy-ruby-rails-windows-2008-server-... greets --http://www.rodolinux.com.ar I must not fear. Fear is the mind-killer. I will face my fear. I will permit it to pass over me and through me. And when it has gone past I will turn the inner eye to see its path. Where the fear has gone there will be nothing. Only I will remain. - Bene Geserit's Fear Lethany - Dune Trilogy - Frank Herbert -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.comrubyonrails-talk%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. -- http://www.rodolinux.com.ar I must not fear. Fear is the mind-killer. I will face my fear. I will permit it to pass over me and through me. And when it has gone past I will turn the inner eye to see its path. Where the fear has gone there will be nothing. Only I will remain. - Bene Geserit's Fear Lethany - Dune Trilogy - Frank Herbert -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Rails 3 tagging
I'm using acts_as_taggable_on to add tags to posts, other tagging plugins/gems don't work with rails 3. I can edit/display tags on the post model and the tags controller displays the posts tagged by name i.e /tags/post-tag-name/. The functionality I want is to turn the tags on the posts pages into links to display the other posts with the same tag. I followed the tutorial in sitepoints 'simply rails 2' which uses acts_as_taggable_on_steroids but I'm stuck with the following error; ActionView::MissingTemplate in Posts#show Missing partial acts_as_taggable_on/tags/tag with {:handlers=[:erb, :rjs, :builder, :rhtml, :rxml], :formats=[:html], :locale=[:en, :en]} in view paths ../app/views Extracted source (around line #28): 25: div id=tags 26: % unless @post.tag_list.empty? % 27: p class=tags 28: %= render :partial = @post.tags %/p 29: % end % ... class Post ActiveRecord::Base ... acts_as_taggable_on :tags end class TagsController ApplicationController def show @post = Post.tagged_with(params[:id]) end end _tag.html.erb %= link_to, tag_path(:id = tag.name) % posts/show.html.erb div id=tags % unless @post.tag_list.empty? % p class=tags %= render :partial = @post.tags %/p % end % /div Also trying to add a tag cloud at tags/index.html as described here http://github.com/mbleigh/acts-as-taggable-on gives me a routing error of; No route matches {:action=tag, :id=news, :controller=tags} -- Posted via http://www.ruby-forum.com/. -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: multiple domain names mapping to different rails app URLs
Am I on the right lines ? -- Posted via http://www.ruby-forum.com/. -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] [Job] Permanent RoR job in Andover, MA
OneVision is an emerging company specializing in work flow technology for the printing and publishing industry.? Innovative products, high-value solutions, and solid management philosophies are key factors to the company?s global growth and success.? The company has over 100 employees worldwide, with headquarters located in Germany, and subsidiary offices in France, United Kingdom, Brazil, Singapore, India, and the US.? We are looking for an experienced Ruby On Rails developer to work on our Cloud Computing project. The position being offered is for our U.?S.? research and development facility located in Andover, MA.? The ideal candidate will be a US citizen with a BS in Computer Science or a related field and excellent communication skills and fluency in English. Experience should include the following: Strong Ruby on Rails skills Agile development Test driven development, unit tests, etc. XML, SQL Linux, Mac OS X Current Internet technology Web applications and services Amazon Web Services Compensation is commensurate with experience. OneVision provides a competitive compensation and benefits package, including; salary, 401k, Major Medical, Dental. Contact Information: OneVision Software, Inc. Andover, Ma 01810-1429 www.OneVision.com Email resume to: recruit...@onevision.com -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Re: Validating model depending on controller action
Thanks to everybody for your answers. I have to say that finally I resorted to some work around solution. From the reopen method in the controller I modify another model vble adding special chars. In the model validation method, I search for those chars in the vble and if they are there, remove them and do not perform the regular validation over the boolean field. -- Posted via http://www.ruby-forum.com/. -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] JRuby + Windows Service
Wassup everyone? I'm trying to deploy a application on windows server 2000, developed with JRuby. My point is, there's someway to deploy using windows service to start the application as a service, instead using a java application server? Thanks -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: rspec and autotest problems
I had the exact same issues (also running Win7 64-bit). My fix for the rspec issue was adding the path of my rspec.bat file to the environment variable path. Mine looks something like this... C:\server\Ruby192\lib\ruby\gems\1.9.1\bin For autotest, I discovered I had two versions installed, 4.3.2 and 4.4.1. I went ahead and uninstalled them both and then ran... gem install autotest Everything seems to be working now. -- Posted via http://www.ruby-forum.com/. -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] bundler installs gems in project rspec directory?
Having just converted my project to rails3 I now note that bundler installs gems into a directory called rspec in the project root. Since this defeats entirely the purpose of having central gem libraries I need to know how to turn this 'feature' off. Out of pathological curiosity I do not mind finding out how this happened to me and why such a thing is even possible, but I can certainly live without that information. However, I really do need to know how to stop this from happening. -- Posted via http://www.ruby-forum.com/. -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Problems when connecting to Sql server 2008 odbc no such file to load error
After som experimenting i am totally and utterly lost. I run bundle install on my bundle and for example get using ruby-odbc i then when i start my rails server get require: no such file to load -- ruby-odbc why? On 26 Okt, 15:17, Fredrik TiC Jansson fredrikjansson1...@gmail.com wrote: Thinking this was just a windows problem was wrong ! i am apperently doing something really really wrong. i cant seem to get any gem besides rails to install properly ! installing mongrel works but installing dbd-odbc,dbi,activerecord-sqlserver-adatper and trying to use it always gives the no such file to load -- odcb error ! i have had som other errors which where solved by manually moving the files to the ruby appears to be looking for them but i am suspecting this is not the way to do it. On 26 Okt, 11:00, Fredrik TiC Jansson fredrikjansson1...@gmail.com wrote: Windows server 2003 the app was originally developed on OSX snow leopard using just sqlite3 and i sucessluffy migrated it and got it running without a hitch on win server 2003 but i have to get it working with SQL sever 2008 for production purposes (sqlite3 just wont cut it) On 25 Okt, 17:37, radhames brito rbri...@gmail.com wrote: @Fredrik TiC Jansson What os are you running your dev on? -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: bundler installs gems in project rspec directory?
I found it. -- Posted via http://www.ruby-forum.com/. -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] Re: Display Time benchmark on page
Then I would like to show on footer of my page for application time and active record time use for user to see by themselves. What is the bottleneck , may be database server , may be network of some point. Just don't want to time it by myself if the information live some where ? Work backwards from line 19/20 of... http://github.com/rails/rails/blob/master/actionpack/lib/action_controller/log_subscriber.rb -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: bundler installs gems in project rspec directory?
I forgot to mention the solution: in .bundle/config BUNDLE_DISABLE_SHARED_GEMS: 0 However, I seem to observe that running bundle install resets this value to 1. -- Posted via http://www.ruby-forum.com/. -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Re: Re: Forcing rails to output HTML4 rather then XHTML?
Rimantas Liubertas wrote in post #957137: ...or not. Yes, of course it's fine to use new attributes that older browsers will ignore. However, HTML 5 differs from HTML 4 not just in its repertoire of attributes and elements, but also *in its basic syntax* -- HTML 5 is no longer a subset of SGML as HTML ≤4 is. That's he part that (potentially) breaks graceful degradation. It breaks absolutely nothing. You cannot possibly know this with certainty, I think. Since non-HTML5-aware browsers use SGML syntax in non-XHTML documents, HTML5 self-closing tags shouldn't be interpreted as self-closing tags (and are invalid HTML4 due to the trailing ). The fact that, in practice, most browsers are lenient in this respect doesn't mean that this behavior should be relied on. More than that, only because browsers don't give a damn about SGML rules all that XHTML nonsense was possible: I think you've got it backwards. Self-closing XML-tags only became necessary to support in browsers when XHTML was introduced. Before that, no one would have thought to use them, and so SGML parsing could (and perhaps should) have been the order of the day. according to SGML br / should be rendered as if it was br gt; (search for SGML SHORTTAG). Right. So the trailing isn't valid HTML4, so you can't assume that you can use it (outside an XHTML context) in a pre-HTML5 browser. Anyway, back to the HTML4 rather than XHTML, which has little to do with HTML5 anyway. IE6 perfectly supports XHTML and its br / tags (with all of the usual IE6 quirks of course), so there is no reason to go to HTML4 if that is your concern. IE6 (and any version of IE) does not support XHTML at all. Try to feed them proper XHTML (that's with the MIME type application/xhtml+xml) and see what happens. I think this was finally fixed in IE7, IIRC. They just silently ignore all those slashes. Right. HTML5 finally fixes this, and you can use a syntax you like for your HTML5 documents. However, if you want XHTML5 you MUST server your document with application/xhtml+xml: and by doing so be aware of all the differences in behaviour this brings. Yup. Regards, Rimantas Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- Posted via http://www.ruby-forum.com/. -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: use net/ldap from my controller
Peter (Guo) Pei wrote in post #957055: I downloaded net-ldap gem and had no problem to use it from non-rail applications. But when I require 'net/ldap' from inside a rails controller. Rails complains that it cannot load LoadError (no such file to load -- net/ldap): app/controllers/supplier_controller.rb:1 You shouldn't be calling it from inside your controllers anyway. That sort of logic goes in a model. Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- Posted via http://www.ruby-forum.com/. -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Re: Forcing rails to output HTML4 rather then XHTML?
Robert Walker wrote in post #957044: Marnen Laibow-Koser wrote in post #956924: Right. But when the syntax -- not just the semantics -- changes, then I start worrying. Time for me to do more research. Okay, so let's talk specifics. Assuming valid HTML 5 markup with no HTML 5 specific features, what breaks on what browsers. Valid HTML 5 markup (with XML-style self-closing tags) is invalid HTML 4 markup (because, as Rimantas said, in HTML 4, br/ is equivalent to br, with an invalid extra ). That's all you need to know to know that this is a bad thing. Best, -- Marnen Laibow-Koser http://www.marnen.org marnen @marnen.org -- Posted via http://www.ruby-forum.com/. -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: How to make an ActiveRecord::Base object to have a list of strings?
Matias Fierro wrote in post #956786: Serialize ? What do that ? It does exactly what the docs say it does. Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- Posted via http://www.ruby-forum.com/. -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] Re: rspec and autotest problems
current auto test has issues with latest rails and ruby i think , mine also stays in limbo after loading autotest/rails and im running on ubuntu in 2 machines and is the same result -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] Display Time benchmark on page
On Mon, Oct 25, 2010 at 6:35 PM, Pinit Asavanuchit li...@ruby-forum.com wrote: Like we saw in console or rails log show totaltime, database time, rendering time. on my page footer in production. Possibly this is what you want: http://rubygems.org/gems/rails-footnotes HTH, -- Hassan Schroeder hassan.schroe...@gmail.com twitter: @hassan -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Re: pattern findings using “find” in Rails
PalaniKannan K wrote in post #957235: I tried def author_yr #{self.author_year.last(4)} end. But it shows Undefined local variable or method 'author_yr' when i use author_yr in find by :order = [author_year like = ?, author_yr]. Please suggest me some idea in ordering. Palani Kannan. K, Impossible. You're defining author_yr in a ruby model, but expecting the DATABASE to know what that is. Doesn't work that way. As Fred mentioned, you need to use a database function that looks at the author_year field (the last 4 characters) to order upon. Look in the manuals for whatever DB engine you're using for string functions. That's what goes in the :order = [] -- Posted via http://www.ruby-forum.com/. -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Re: pattern findings using “find” in Rails
Ar Chron wrote in post #957266: PalaniKannan K wrote in post #957235: I tried def author_yr #{self.author_year.last(4)} end. But it shows Undefined local variable or method 'author_yr' when i use author_yr in find by :order = [author_year like = ?, author_yr]. Please suggest me some idea in ordering. Palani Kannan. K, Impossible. You're defining author_yr in a ruby model, but expecting the DATABASE to know what that is. Doesn't work that way. Where is the OP doing that? What he is doing instead that is wrong is using a Rails-style conditions array in an ORDER BY clause. *That* doesn't work that way. Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- Posted via http://www.ruby-forum.com/. -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Problems when connecting to Sql server 2008 odbc no such file to load error
Fredrik TiC Jansson wrote in post #957147: Windows server 2003 the app was originally developed on OSX snow leopard using just sqlite3 and i sucessluffy migrated it and got it running without a hitch on win server 2003 but i have to get it working with SQL sever 2008 for production purposes (sqlite3 just wont cut it) You might like TinyTds. I've just changed an app over to it here at work, and I am really liking it. Also, if you have a choice, *do not* use a Windows server, and *do not* use MS SQL. I recommend *nix of some sort (I use Ubuntu) and PostgreSQL for ease and security of deployment. Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- Posted via http://www.ruby-forum.com/. -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] Re: Re: pattern findings using “find ” in Rails
Palani Kannan. K, Impossible. You're defining author_yr in a ruby model, but expecting the DATABASE to know what that is. Doesn't work that way. As Fred mentioned, you need to use a database function that looks at the author_year field (the last 4 characters) to order upon. I got your point. I will look for last 4 character to order up in database function. thank you for suggestion. Look in the manuals for whatever DB engine you're using for string functions. That's what goes in the :order = [] -- Posted via http://www.ruby-forum.com/. -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.comrubyonrails-talk%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. -- With Regards, Palani Kannan. K, Doctoral Researcher, Microbiology Department, German Collection Center for Microorganisms and Cell Cultures, Helmholtz-HZI Infectious diseases Research Campus, 38124, Braunschweig, Germany. -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Button click, rendering back to the same page
Hi All, Am having a lot of trouble trying to solve a very simple problem. I have a button on my form which when clicked needs to do a quick calculation then returns back to the same page to show the result. VIEW. %=button_to How much could I potentially borrow?, :action = newmortgagecalc % CONTROLLER def newmortgagecalc * some calculations here * render end What do I need to render in the controller method to get back to the same page? Thanks Richie. -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Create super-simple adding application
It doesn't say any numbers, the relevant log info just says it processed the GET and got the layout. On Oct 26, 4:32 am, Frederick Cheung frederick.che...@gmail.com wrote: On Oct 26, 3:18 am, debalmoto debalm...@gmail.com wrote: Ok, so I figured out what was causing the error, I wasnt calling params[:number_one] in the right place. Fixing this took care of the error. Now I can call them in my controller like so: @a = params[:number_one].to_i @b = params[:number_one].to_i @sum = @a + @b But when I put numbers in my text boxes, it always shows 0. I even put this is my view: p%= params[:number_one].to_i + params[:number_two].to_i %/p And it also always shows 0. What am I doing wrong? I'd check the development.log file to see what parameters are actually getting submitted. Fred -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: multiple domain names mapping to different rails app URLs
This might be a good time to mention that with the rails 3 redesign, you can specify much more powerful constraints from within the router. Katz's website has a nice article on it: http://yehudakatz.com/2009/12/26/the-rails-3-router-rack-it-up/ The part I found most interesting was this: Basecamp::Application.routes do constraints(:subdomain = support) do match /foo/bar, :to = foo#bar end end As it turns out, you can swap :hostname (or :host) into the place of :subdomain and setup different routes for different domains. Using this in combination with some sort of hostname checking in a before_filter is all I needed for my project. No need for any URL rewriting in nginx. Hope that helps. On Oct 19, 9:21 am, bingo bob li...@ruby-forum.com wrote: Could well be overcomplicating things! Walter's point here is sounds closest I think - I'll try it. You can do redirects that fundamentally rewrite the URL from the server's perspective, without changing what the user sees in their browser's location bar. So you could avoid the whole routes.rb hack I've outlined above by rewriting requests for [www.]foo.com to baz.com/ property/1 [NS,QSA] (those flags keep the URL whatever was written in the browser. Then the user could enterwww.foo.com/editand the request would bewww.baz.com/property/1/editat your server. As it stands apache modrewrite in place but not finished - working though, :-)! http://www.chaletcordee.co.uk/ as you will witness if you visit this is rewritten to this in the users browser...http://www.chaletcordee.co.uk/properties/1/ Fine, content works but I'd like this to behttp://www.chaletcordee.co.uk/ in the users browser in a similar manner http://www.apartmentnicole.co.uk/ goes tohttp://www.apartmentnicole.co.uk/properties/2/ I'd like this to behttp://www.apartmentnicole.co.uk/ in the users browser if you click on the photos page after visitinghttp://www.chaletcordee.co.uk/ you get here...http://www.chaletcordee.co.uk/properties/1/photos I'd like this to behttp://www.chaletcordee.co.uk/photos in the users browser, etc phew - is anyone still reading - I doubt it ! :-). -- Posted viahttp://www.ruby-forum.com/. -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] Button click, rendering back to the same page
On Tue, Oct 26, 2010 at 3:40 PM, Creative Technologist rich...@creativetechnologist.co.uk wrote: Hi All, Am having a lot of trouble trying to solve a very simple problem. I have a button on my form which when clicked needs to do a quick calculation then returns back to the same page to show the result. VIEW. %=button_to How much could I potentially borrow?, :action = newmortgagecalc % CONTROLLER def newmortgagecalc * some calculations here * render end render :action = :same_as_the_view but if th calculation is not persistend (wont be saved to the db), use a js function and make everything in the client side -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Re: Forcing rails to output HTML4 rather then XHTML?
Marnen Laibow-Koser wrote in post #957260: Robert Walker wrote in post #957044: Okay, so let's talk specifics. Assuming valid HTML 5 markup with no HTML 5 specific features, what breaks on what browsers. Valid HTML 5 markup (with XML-style self-closing tags) is invalid HTML 4 markup (because, as Rimantas said, in HTML 4, br/ is equivalent to br, with an invalid extra ). That's all you need to know to know that this is a bad thing. I'm was not asking about validity. Markup validity is directly dependent upon the DOCTYPE specified for the page. What I'm trying to find out is specifically how IE 6 breaks (as in incorrectly renders the page) when using valid HTML 5 markup (including self-closing tags) with !DOCTYPE html. Again assume no HTML 5 only features only markup syntax. I'm asking because I don't personally use any version of IE, much less IE 6. I'd really like to know if IE 6 actually has problems rending HTML 5 markup. -- Posted via http://www.ruby-forum.com/. -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Ruby on Rails developer required
Hello, Looking urgently for Ruby on Rails developer for direct fortune client. - Location: New Jersey Contract: Long term globally known fortune client is looking to interview and hire 2 Ruby on rails developer asap. Please call Sonia at 732-549-6800 ext 238 or email at sj...@chenoainc.com for any further information you require. Thanks, Sonia Jani 732-549-6800 ext 238 / sj...@chenoainc.com -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Create super-simple adding application
On 26 Oct, 20:56, debalmoto debalm...@gmail.com wrote: It doesn't say any numbers, the relevant log info just says it processed the GET and got the layout. Sounds like the parameters aren't getting sent What does the rest of the view with the form look like? Fred On Oct 26, 4:32 am, Frederick Cheung frederick.che...@gmail.com wrote: On Oct 26, 3:18 am, debalmoto debalm...@gmail.com wrote: Ok, so I figured out what was causing the error, I wasnt calling params[:number_one] in the right place. Fixing this took care of the error. Now I can call them in my controller like so: @a = params[:number_one].to_i @b = params[:number_one].to_i @sum = @a + @b But when I put numbers in my text boxes, it always shows 0. I even put this is my view: p%= params[:number_one].to_i + params[:number_two].to_i %/p And it also always shows 0. What am I doing wrong? I'd check the development.log file to see what parameters are actually getting submitted. Fred -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Create super-simple adding application
p %= text_field_tag(:number_one, value = 0) % %= text_field_tag(:number_two, value = 0) % /p p %= @sum % /p That's all of it. My controller: class UserController ApplicationController def home a = params[:number_one].to_i b = params[:number_one].to_i @sum = a + b end end On Oct 26, 5:40 pm, Frederick Cheung frederick.che...@gmail.com wrote: On 26 Oct, 20:56, debalmoto debalm...@gmail.com wrote: It doesn't say any numbers, the relevant log info just says it processed the GET and got the layout. Sounds like the parameters aren't getting sent What does the rest of the view with the form look like? Fred On Oct 26, 4:32 am, Frederick Cheung frederick.che...@gmail.com wrote: On Oct 26, 3:18 am, debalmoto debalm...@gmail.com wrote: Ok, so I figured out what was causing the error, I wasnt calling params[:number_one] in the right place. Fixing this took care of the error. Now I can call them in my controller like so: @a = params[:number_one].to_i @b = params[:number_one].to_i @sum = @a + @b But when I put numbers in my text boxes, it always shows 0. I even put this is my view: p%= params[:number_one].to_i + params[:number_two].to_i %/p And it also always shows 0. What am I doing wrong? I'd check the development.log file to see what parameters are actually getting submitted. Fred -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] Re: Re: Forcing rails to output HTML4 rather then XHTML?
On Oct 26, 2010, at 4:56 PM, Robert Walker wrote: Marnen Laibow-Koser wrote in post #957260: Robert Walker wrote in post #957044: Okay, so let's talk specifics. Assuming valid HTML 5 markup with no HTML 5 specific features, what breaks on what browsers. Valid HTML 5 markup (with XML-style self-closing tags) is invalid HTML 4 markup (because, as Rimantas said, in HTML 4, br/ is equivalent to br, with an invalid extra ). That's all you need to know to know that this is a bad thing. I'm was not asking about validity. Markup validity is directly dependent upon the DOCTYPE specified for the page. What I'm trying to find out is specifically how IE 6 breaks (as in incorrectly renders the page) when using valid HTML 5 markup (including self-closing tags) with !DOCTYPE html. Again assume no HTML 5 only features only markup syntax. I'm asking because I don't personally use any version of IE, much less IE 6. I'd really like to know if IE 6 actually has problems rending HTML 5 markup. I haven't tried it myself, and I upgraded my test machine to IE8 at the beginning of the summer, but I believe that it treats it like tag soup and ignores any tag that it doesn't understand. That is, it shows the content of that unknown tag, but it doesn't apply any special meaning to the tag. It would likely be Quirks Mode all the way down, definitely not something that looked like you cared about that browser, but it would be readable in the sense that all the words would be there. Walter -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: trying to install postgres gem on fedora 12.
just in case forks are still struggling with this(at least I was this morning on fedora core 14 beta). I solved the same problem by installing required development tools as: sudo yum groupinstall 'development tools' Cheers! ...chad -- Posted via http://www.ruby-forum.com/. -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Re: Re: Forcing rails to output HTML4 rather then XHTML?
Walter Davis wrote in post #957346: On Oct 26, 2010, at 4:56 PM, Robert Walker wrote: that this is a bad thing. I'm asking because I don't personally use any version of IE, much less IE 6. I'd really like to know if IE 6 actually has problems rending HTML 5 markup. I haven't tried it myself, Nor have I. and I upgraded my test machine to IE8 at the beginning of the summer, but I believe that it treats it like tag soup and ignores any tag that it doesn't understand. That is, it shows the content of that unknown tag, but it doesn't apply any special meaning to the tag. It would likely be Quirks Mode all the way down, definitely not something that looked like you cared about that browser, but it would be readable in the sense that all the words would be there. That would be my guess as well. Walter Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- Posted via http://www.ruby-forum.com/. -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Display Time benchmark on page
Thank you every body I will try your suggestion. -- Posted via http://www.ruby-forum.com/. -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Form_for problem after upgrading
I am upgrading to rails 3 and afer diong so, none of my form_for are working. (I can not actually say not all of them are working but the few that i have tried are not). The page loads fine but the form is not output. This is after making the the change from % to %=. A sample form is below. %= form_for @user_session, :url = user_session_path do |f| % Email br/ %= text_field_tag :login %br/ Password br/ %= f.password_field :password %br/ Remember Me %= f.check_box :remember_me % br/ %= f.submit Login % % end % -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Call backs not working in jquery 1.4.3 with rails 3
Hi All, I am using rails application of version 3.0.0 and i have downloaded jquery latest version 1.4.3 to use in my application. However jquery conflicted with rails app so i have added noconflict code as follows script // this allows jquery to be called along with scriptaculous and YUI without any conflicts // the only difference is all jquery functions should be called with $j instead of $ // e.g. $j('#div_id').stuff instead of $('#div_id').stuff var $j = jQuery.noConflict(); /script and things started working fine but jquery call backs did not worked and showed any error either. So what i did is: * removed the noconflict code * replaced the existing rails.js with jquery based rails.js * added the jquery.js on top of %= javascript_include_tag :defaults % in application.html.erb page then everything works fine. I want to add jquery.js in some pages where needed and need to achieve remote method calling and jquery callbacks. Any help would be great. -- Posted via http://www.ruby-forum.com/. -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Create super-simple adding application
On Oct 26, 10:48 pm, debalmoto debalm...@gmail.com wrote: p %= text_field_tag(:number_one, value = 0) % %= text_field_tag(:number_two, value = 0) % /p p %= @sum % /p That's all of it. Time for HTML lesson 1: if you want inputs to get sent to the server, they need to be enclosed in a form (modulo javascript trickery). Fred My controller: class UserController ApplicationController def home a = params[:number_one].to_i b = params[:number_one].to_i @sum = a + b end end On Oct 26, 5:40 pm, Frederick Cheung frederick.che...@gmail.com wrote: On 26 Oct, 20:56, debalmoto debalm...@gmail.com wrote: It doesn't say any numbers, the relevant log info just says it processed the GET and got the layout. Sounds like the parameters aren't getting sent What does the rest of the view with the form look like? Fred On Oct 26, 4:32 am, Frederick Cheung frederick.che...@gmail.com wrote: On Oct 26, 3:18 am, debalmoto debalm...@gmail.com wrote: Ok, so I figured out what was causing the error, I wasnt calling params[:number_one] in the right place. Fixing this took care of the error. Now I can call them in my controller like so: @a = params[:number_one].to_i @b = params[:number_one].to_i @sum = @a + @b But when I put numbers in my text boxes, it always shows 0. I even put this is my view: p%= params[:number_one].to_i + params[:number_two].to_i %/p And it also always shows 0. What am I doing wrong? I'd check the development.log file to see what parameters are actually getting submitted. Fred -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Rails 3 - Creating a JSON response to display Search Results
Hello, I'm working to have Rails 3 respond with a JSON request which will then let the app output the search results with the jQuery template plugin... For the plugin to work, it needs this type of structure: [ { title: The Red Violin, url: /adadad/123/ads, desc: blah yada }, { title: Eyes Wide Shut, url: /adadad/123/ads, desc: blah yada }, { title: The Inheritance, url: /adadad/123/ads, desc: blah yada } ] In my Rails 3 controller, I'm getting the search results which come back as @searchresults, which contain either 0 , 1 , or more objects from the class searched. My question is how to convert that to the above structure (JSON)... Thank you! ... The front-end search page will need to work for multiple models which have different db columns. That's why I'd like to learn how to convert that to the above to normalize the results, and send back to the user. -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Create super-simple adding application
Frederick Cheung wrote in post #957392: On Oct 26, 10:48pm, debalmoto debalm...@gmail.com wrote: p %= text_field_tag(:number_one, value = 0) % %= text_field_tag(:number_two, value = 0) % /p p %= @sum % /p That's all of it. Time for HTML lesson 1: if you want inputs to get sent to the server, they need to be enclosed in a form (modulo javascript trickery). Fred Exactly. So you may want to change the view code to look like this: %= form_tag('/') do -% p %= text_field_tag(:number_one, value = 0) % %= text_field_tag(:number_two, value = 0) % %= submit_tag 'Calculate' % /p % end % p %= @sum % /p -- Posted via http://www.ruby-forum.com/. -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.