Re: [Rails] can not connect to the mysql database

2010-08-22 Thread Irfan Ahmed
As you want to see the database.yml and errors which are showing I just mentioned above. I am giving here again the database.yml files details: development: adapter: mysql database: depot_development host: localhost username: password: test: adapter: mysql database: depot

[Rails] Re: Get a collection using an array of ids, keeping the order

2010-08-22 Thread Robert Head
Max Williams wrote: > The weird thing is, i've gone to my console to try it out, and rails is > now always giving me the resources back in the order of the id array > anyway, whether i use the field option or not. It's the same with any > of my AR classes! I'm sure that this didn't used to hap

[Rails] Sharing sessions between a rails3 app and a rails2 app. Rails 2 app crashes.

2010-08-22 Thread Tim Uckun
Hey all. I have two apps. One is a rails3 app and the other is a rails 2 app. Using proxying I am routing actions in the myapp.com/foo to the rails2 app. It almost works! I can set a session variable and a cookie variable on the first app (myapp.com) and then read them on the second app (myapp.co

[Rails] Re: When after_save isn't after the save....

2010-08-22 Thread Danny Burkes
If you really want callbacks after commit, you might try http://github.com/freelancing-god/after_commit - D -- 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

[Rails] determining link geo-location

2010-08-22 Thread Rajinder Yadav
I am trying to figure out how to get the user's geo-location when a request comes in after they've clicked on a link. Is there a easy way to do this in rails, also is the geo-location provided by the user's browser, or is there another way this is determined? Thanks! -- Kind Regards, Rajinder

[Rails] Paperclip - possible to modify file and load file content as string?

2010-08-22 Thread David Kahn
Wanted to see if anyone knows of a way - or the preferred way - to do these three tasks with Paperclip: 1) Access the content of an uploaded file before save. I did find that the following works before save, but is there a clearer way to do this: self.uploaded_file.queued_for_write[:original].ope

[Rails] Re: incompatible character encodings: ASCII-8BIT and UTF-8

2010-08-22 Thread Sven Koesling
Gudleik Rasch wrote: > I've been struggling with the same issue a few times, and the solution > that worked for me was to use a different mysql driver: ruby-mysql > > # in config/environment.rb: > config.gem 'ruby-mysql' > > # or in Gemfile: > gem 'ruby-mysql' > > The encoding must also be set i

[Rails] Re: Trying to make a user list from 2 fields

2010-08-22 Thread Bob Smith
What I need returned is a list of the names in the fields name and sname put together in alphabetical order with their ids so I can make this list into an index screen with edit links. I assume the id would be Household.id, just looking for a way to combine two name fields for the index page.

[Rails] Re: incompatible character encodings: ASCII-8BIT and UTF-8

2010-08-22 Thread Sven Koesling
forgot to say: a workaround that works for me is to add the method ".force_encoding('utf-8')" to any variable with date from my database eg.: student.name.force_encoding('utf-8') Good Night for now :-) S. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are

[Rails] Re: incompatible character encodings: ASCII-8BIT and UTF-8

2010-08-22 Thread Sven Koesling
Hi, did You find a solution? I have the same problem on all of my projects. DB in UTF8, rails in UTF8, but when it comes to partials with data with german umlauts I get the mentioned error. As far as I understand it's a problem with the erb rendering engine that forces ASCII encoding. This en

[Rails] .htaccess and Rails direction

2010-08-22 Thread Ruby on Rails: Talk
Hi I'm having a bit of a battle with NativeSpace who are hosting my rails app. Having had to downgrade from Rails 3.0.0.rc to 2.3.8 and then finding that I was having major issues with that version and Mongrel 1.1.15 I've had to go back down to 2.3.5!!! Now I have the following in my .htaccess:

[Rails] Re: Re: Are those classes built-in?

2010-08-22 Thread Abder-Rahman Ali
Colin Law wrote: > On 22 August 2010 15:24, Abder-Rahman Ali wrote: >> I have created a "main.css", and referred to it in >> "application.html.erb" as follows: >> >> <%= stylesheet_link_tag "main" %> >> >> But, in my "main.css" there is NO "field" class. >> >> don't you think it is built in Rails

Re: [Rails] can not connect to the mysql database

2010-08-22 Thread Colin Law
On 22 August 2010 14:20, Irfan Ahmed wrote: > create.sql (saved in /db) > drop table if exists products; >     create table products ( >     id int not null auto_increment, >     title varchar(100) not null, >     description text not null, >     image_url varchar(200) not null, >     price decima

[Rails] JOBS - Ruby on Rails Developers Required - D ublin - Up to £45,000 + Relocation Expenses

2010-08-22 Thread Nicola @ Ingenium
Ruby on Rails Developer My client is looking for self starting developers who will be involved in design, development, and testing of new software product. The role will be involved in developing innovative games in a true start up environment with one of the fastest growing companies in the onlin

[Rails] Re: Re: Re: Are those classes built-in?

2010-08-22 Thread Abder-Rahman Ali
I'm using Rails 3. And, as mentiond I don't have "scaffold.css", and have "main.css". -- 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...@google

Re: [Rails] Re: Are those classes built-in?

2010-08-22 Thread Colin Law
On 22 August 2010 15:24, Abder-Rahman Ali wrote: > I have created a "main.css", and referred to it in > "application.html.erb" as follows: > > <%= stylesheet_link_tag "main" %> > > But, in my "main.css" there is NO "field" class. > > don't you think it is built in Rails itself? Have a look in sca

[Rails] Re: "You are being redirected" when switching controllers

2010-08-22 Thread Lenart Rudel
Iwan Buetti wrote: > Same problem (but with v. 2.3.8) and same solution (downgrade to 2.3.5). > > (With glesys.se VPS, Ubuntu 8.04, monit+mongrel) > > Thanks a lot! > > Iwan Got same problem on Rails 2.3.8, running FreeBSD 7.0, Mongrel 1.1.5 (using clusters). Downgrading to Rails 2.3.5 solved

Re: [Rails] Re: Re: Are those classes built-in?

2010-08-22 Thread Colin Law
On 22 August 2010 22:07, Abder-Rahman Ali wrote: > Colin Law wrote: >> On 22 August 2010 15:24, Abder-Rahman Ali wrote: >>> I have created a "main.css", and referred to it in >>> "application.html.erb" as follows: >>> >>> <%= stylesheet_link_tag "main" %> >>> >>> But, in my "main.css" there is NO

[Rails] Rails 3: Error saving an object with no useful information

2010-08-22 Thread Heinz Strunk
Hey, I'm kinda desperate cause I'm getting an error and have no idea how to fix this since it doesn't give me any information hinting where the problem is: irb(main):054:0> reload!;User.last.save! Reloading... NameError: undefined local variable or method `to_ary' for # from D:/ruby192/lib

[Rails] Re: How to disable button generated by submit_to_remote?

2010-08-22 Thread pepe
These 2 versions will disable the button: <%= submit_to_remote "add", "Add", :url => { :action => "add_groups" }, :html => {:update => 'divgrouptable', :disabled => true} %> <%= submit_to_remote "add", "Add", :url => { :action => "add_groups" }, :update => 'divgrouptable', :html => {:disabled => t

[Rails] Re: When after_save isn't after the save....

2010-08-22 Thread Frederick Cheung
On Aug 21, 5:47 pm, IAmNan wrote: > So, if there are limitations on what you can do in a callback filter, > we should  probably documented it somewhere. However, I might even > call it a bug. What do you think? > Doesn't sound like anything to do with callbacks to me. I think the root of the p

[Rails] Re: rails3: t.index in migrations not working anymore

2010-08-22 Thread Tony
I've always used add_index(table_name, column_names). My guess is that t.index was deprecated. just use add_index :your_table_name, :name after your create_table block On Aug 22, 10:12 am, Heinz Strunk wrote: > Hello, > > I'm playing around with Rails3 and trying to upgrade one of my > appl

Re: [Rails] passing a hash to a view

2010-08-22 Thread Bill Walton
Hi Dave, On Sun, Aug 22, 2010 at 9:34 AM, Dave Castellano wrote: > Hello everyone, > New to programming Welcome and congratulations on your choice of language / framework ! > and hoping someone can help with this.  I'm trying to > format a hash in a model so I can access the individual values i

[Rails] CodeSnipr Learning can be simple!!

2010-08-22 Thread bapi
Hi, All the group members right at here, we people recently lunched a website CodeSnipr based on Computer language like (PHP, RUBY, HTML, CSS, MYSQL, JQURY, IPHONE DEVELOPMENT, JAVASCRIPT, C++ etc.). CodeSnipr will provide you access to user generated tutorials. Here you can post your code sni

[Rails] Ask for best practices on rails-bestpractices.com

2010-08-22 Thread huang zhimin
Hi http://rails-bestpractices.com added a new feature, asking for best practices, it allows users to ask for a best practice about any rails related work, such as "How to detect N+1 queries?" and "How to upload a large file with progress bar?". Then everyone can post your answer with your own best

Re: [Rails] Re: Re: Flash message doesn't show up

2010-08-22 Thread Bill Walton
On Sun, Aug 22, 2010 at 9:21 AM, Abder-Rahman Ali wrote: > Bill Walton wrote: >> On Sun, Aug 22, 2010 at 8:26 AM, Abder-Rahman Ali >> wrote: >>> I just want to ask, how can we make that notice with a different color >>> and background? Should we do this manually by HTML for example? >> >> Change

[Rails] passing a hash to a view

2010-08-22 Thread Dave Castellano
Hello everyone, New to programming and hoping someone can help with this. I'm trying to format a hash in a model so I can access the individual values in a view as follows. (I pulled most of the code out but this is the basic idea)... def set_format_for_presentation # This method is in the mod

[Rails] Re: What is meant here?

2010-08-22 Thread Abder-Rahman Ali
Frederick Cheung wrote: > On Aug 16, 4:48�pm, Abder-Rahman Ali wrote: > >> >> And, one final thing. What is the "Routing system"? Is it routes.rb? >> > It's a bit more than that - routes.rb is the means by which you > configure the routing system, which could be broadly described as the > part of

[Rails] Re: Embedded Ruby

2010-08-22 Thread Abder-Rahman Ali
Tim Shaffer wrote: > No. Embedding Ruby in a .html.erb file in just tells Rails to use the > ERB templating library. > > It's still processed by the standard Ruby interpreter. > > See the docs for more info: > > http://ruby-doc.org/stdlib/libdoc/erb/rdoc/classes/ERB.html Thanks. -- Posted via

[Rails] Re: Are those classes built-in?

2010-08-22 Thread Abder-Rahman Ali
I have created a "main.css", and referred to it in "application.html.erb" as follows: <%= stylesheet_link_tag "main" %> But, in my "main.css" there is NO "field" class. don't you think it is built in Rails itself? -- Posted via http://www.ruby-forum.com/. -- You received this message because

[Rails] Re: Re: Flash message doesn't show up

2010-08-22 Thread Abder-Rahman Ali
Bill Walton wrote: > On Sun, Aug 22, 2010 at 8:26 AM, Abder-Rahman Ali > wrote: >> I just want to ask, how can we make that notice with a different color >> and background? Should we do this manually by HTML for example? > > Change the values in the selector in application.css > > HTH, > Bill

Re: [Rails] Re: Flash message doesn't show up

2010-08-22 Thread Bill Walton
On Sun, Aug 22, 2010 at 8:26 AM, Abder-Rahman Ali wrote: > I just want to ask, how can we make that notice with a different color > and background? Should we do this manually by HTML for example? Change the values in the selector in application.css HTH, Bill -- You received this message becaus

[Rails] rails3: t.index in migrations not working anymore

2010-08-22 Thread Heinz Strunk
Hello, I'm playing around with Rails3 and trying to upgrade one of my applications to Rails 3.0.0.rc and I get an error which should be still working. Migration: t.index :name When I execute rake: rake aborted! An error has occurred, all later migrations canceled: undefined method `index' for #

[Rails] Re: Flash message doesn't show up

2010-08-22 Thread Abder-Rahman Ali
Thanks a lot everyone. You are correct: Yes, I have added "<%= flash[:notice] %>" in "application.html.erb" I just want to ask, how can we make that notice with a different color and background? Should we do this manually by HTML for example? Thanks. -- Posted via http://www.ruby-forum.com/.

Re: [Rails] can not connect to the mysql database

2010-08-22 Thread Irfan Ahmed
create.sql (saved in /db) drop table if exists products; create table products ( id int not null auto_increment, title varchar(100) not null, description text not null, image_url varchar(200) not null, price decimal(10, 2) not null, primary key (id) ); Database con

Re: [Rails] can not connect to the mysql database

2010-08-22 Thread Colin Law
On 22 August 2010 14:00, Irfan Ahmed wrote: > Hi, I am novice to rails and recently I started learning rails. Still um in > the zero point..As I started making a project in rails following the book > "Agile Web Developement with rails" I cant con not configure my application > to work with mysql.

[Rails] Re: Partials and a question of correct form

2010-08-22 Thread bseanvt
you should keep logic out of views partials. here are a couple different ways to accomplish this 1) create a helper function # app/helpers/application_helper.rb def render_ad_html if not logged_in? or current_user.show_ads? ad = Ad.find_by_controller_name( params[:controller] ) # rende

[Rails] can not connect to the mysql database

2010-08-22 Thread Irfan Ahmed
Hi, I am novice to rails and recently I started learning rails. Still um in the zero point..As I started making a project in rails following the book "Agile Web Developement with rails" I cant con not configure my application to work with mysql. It was a project named depot in the following book. I

Re: [Rails] My first gem

2010-08-22 Thread Bill Walton
Hi Brian, On Sat, Aug 21, 2010 at 6:33 PM, PsiPro wrote: > Hello all, > > I just published my first gem, I've extracted it out from a project > I'm working on and just hope it would be useful to others, and get > some community improvment/suggestions. Congratulations! > The code is located on g

Re: [Rails] Question about RVM installation; where to find .bashrc and/or .bash_profile files?

2010-08-22 Thread Chris Mear
On 22 Aug 2010, at 10:14, pauld wrote: > I am using Snow Leopard, and would like to know where I can find > the .bashrc and/or .bash_profile files. Which directory are they in? > Tried to find them but had no luck. They live in your home directory, e.g. /Users/pdenlinger/.bashrc If you don't

[Rails] Question about RVM installation; where to find .bashrc and/or .bash_profile files?

2010-08-22 Thread pauld
Hi-- Have just installed downloaded and installed RVM from Github and got this message after download: You must now finish the install manually: 1) Place the folowing line at the end of your shell's loading files(.bashrc or .bash_profile for bash and .zshrc for zsh), after all path/variable setti

[Rails] Re: Flash message doesn't show up

2010-08-22 Thread ajey.pot...@gmail.com
In View have you added <%= flash[:notice] %> and <%= javascript_include_tag :defaults %> On Aug 21, 10:35 pm, Abder-Rahman Ali wrote: > In the controller method I have the following: > > def create >   @adv = Adv.new(params[:adv]) >   @adv.save >   flash[:notice] = "Advertisement successfully

Re: [Rails] Partials and a question of correct form

2010-08-22 Thread Colin Law
On 22 August 2010 05:56, Chris wrote: > I'm new to Rails and trying to figure out the correct way to handle > dynamic data in a partial. The partial in question will be used to > display a google ad. The html for this ad will differ based upon the > user (do they pay to not see ads, what the forma

[Rails] Help me... how to convert amchart to pdf

2010-08-22 Thread anton effendi
Hi Guys I need help.. I want to making 1 controller for covert html to pdf.. But that html have amchart (swf). When I tried convert, the swf not loadded... Any body can help me Please -- Senior Rails Developer Anton Effendi - Wu You Duan -- You received this message because you are