[Rails] Re: Controller calling .. ?

2009-07-13 Thread Codeblogger
Hermant, this sounds lika a violation of the MVC pattern. You might want to rethink your design. Regards Nicolai --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, s

[Rails] Conditions don't work

2009-07-13 Thread pl
Hi there, I'm building a private message system for one of my sites. I'm now trying to give users the delete messages in their inbox (not destroy the records but put "archived = true" in them), so they don't come up anymore. This is important because the sender needs to have the message in his se

[Rails] Re: Just a matter of taste or the need of a formal approach?

2009-07-13 Thread Ar Chron
Investigate polymorphic join relationships... you can join arbitrary numbers of other 'things' without adding foreign_keys to your base table (User). A new 'thing' just has to participate in the poly join relationship. Requirement (these can be related to any number of other entities, depe

[Rails] VALIDATION HELP

2009-07-13 Thread Newb Newb
hi all, i have a array of text_field_tags in my Edit form like below <% @name_list.each do |k|%> Name <%= text_field_tag "names[#{k.id}]","#{k.name}"%> <%end%> I want to do modal validation for this form. Any ideas or suggestions to try validation for array of fields Thanks in advance -- P

[Rails] how to integrate svn with rails

2009-07-13 Thread Xiahong Gao
Hi everyone, I am a newbie on rails. I tried to use svn to control my code version. However, I found the following problems: When I typed in "ruby script/generate scaffold product", the added files were not applied in svn. The same problem occurred when I deleted some files by typing in "ruby s

[Rails] Just a matter of taste or the need of a formal approach?

2009-07-13 Thread ms
Hi, thanks for reading this post. At the moment, I am thinking about the following problem: Let's assume the following situation: I've got two entity types called "User" and "Group". Each entity type got some attributes, let's think about "name" and "password" for "User" and "name" as well as "

[Rails] Re: named_scope and its :order function.

2009-07-13 Thread Michael
Thanks very much. Could you give me some more advice how can I do this?I still don't know how to join the two tables...thanks again. > You need to joins the users table if you want to order by a column on > it. > > Fred > > > in the article.rb: > > belongs_to :user > > named_scope :by_user_value,

[Rails] Re: How to manage Tab & Comma separated filds form single text f

2009-07-13 Thread Bhupendra Chaudhari
Please find more below more hints on what the code is : begin f.read.each do |l| if counter > 0 tokens = l.split(/\t/).collect{|ss| ss.delete("\"") } #tokens1 = l.split(/, /) #tokens2 = l.split(/, /)

[Rails] Running a single fixture.

2009-07-13 Thread Stewart
Hello. I need to run a single fixture on my server as part of an update to my application. I noticed that the other tables lost their data when I run "rake db:fixtures:load". How do I make it so that only a single fixture runs and ignores the rest? --~--~-~--~~~---~--

[Rails] Re: Problem deploying app on bluehost

2009-07-13 Thread Roger Pack
> I want to know if i can get a similar deal with better hosting > provider , can I get something good for ror applications for ard 50$ > an year. I think dreamhost is similar. And hopefully easier. =r -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~-

[Rails] Re: Data-only migrations when User model does not store plain text passwords

2009-07-13 Thread steven_noble
In case anyone else has this a problem, a work-around is to popular the Users table using seed_fu. Then you can just pass it the :password and :password_confirmation, and your app takes care of generating the salted versions etc. s. On Jul 13, 6:19 pm, steven_noble wrote: > Hi all, > > How do

[Rails] Re: Data-only migrations when User model does not store plain text passwords

2009-07-13 Thread steven_noble
In case anyone has a similar problem, a workaround is to populate your Users table using seed_fu: http://github.com/mbleigh/seed-fu/tree/master s. On Jul 13, 6:19 pm, steven_noble wrote: > Hi all, > > How do you create a data-only migration for my User model that adds a > password salt and enc

[Rails] What is dispatch.rb?

2009-07-13 Thread Pål Bergström
What is the file dispatch.rb for? I also have dispatch.cgi and dispatch.fcgi. Running on LiteSpeed Web Server -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails

[Rails] How to manage Tab & Comma separated filds form single text f

2009-07-13 Thread Bhupendra Chaudhari
Hi, I am modifying on script. I am using this script to import data form text-delimited file into PosgresSql database. I have already setup a code for tab separation but facing problem in comma separation. In text-delimited file there is foulr field which are inter related. first "organization &

[Rails] Re: Use of self in a class

2009-07-13 Thread David A. Black
Hi -- On Mon, 13 Jul 2009, Buzz Hill wrote: > > JangoSteve wrote: >> In other words, you just use def get_payment_types if >> get_payment_types is to be performed on a specific instance of that >> class, and def self.get_payment_types if it is just a generic function >> for that class... > > I g

[Rails] Re: Ways to chart data in Rails?

2009-07-13 Thread paron
There's Scruffy, http://scruffy.rubyforge.org/ , of course. I don't see the animations and gradients and such, though. They're all possible in SVG, but unfortunately, I can't say it's as easy as the Flash-based stuff. It seems that programmer graphics tend to have a "There, I fixed it" look to th

[Rails] Re: Associations - Better solution?

2009-07-13 Thread Pradeep Gatram
You can try something on these lines too class User < ActiveRecord::Base has_many :audits_as_auditor, :class_name => 'Audit', :foreign_key => 'auditor_id' has_many :audits_as_tenant, :class_name => 'Audit', :foreign_key => 'tenant_id' end Pradeep On Jul 13, 11:07 am, Jitu wrote: > Have you

[Rails] Re: How to add default value to text_field_with_auto_complete

2009-07-13 Thread Thriving K.
Thank you a lot, i will try harder next time -- 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-ta

[Rails] Re: Use of self in a class

2009-07-13 Thread Buzz Hill
JangoSteve wrote: > In other words, you just use def get_payment_types if > get_payment_types is to be performed on a specific instance of that > class, and def self.get_payment_types if it is just a generic function > for that class... I guess what I am confused about is this: Dave Thomas talks

[Rails] Disable session cookie during a request

2009-07-13 Thread Alex
My code makes extensive use of sessions for things like the logged in user. I have added a stateless API that authenticates on each request, but it uses underlying code that sets session data. In the stateless case, the session is populated on each request. I don't want it persisted. Is there

[Rails] Re: Installing mysql with macports

2009-07-13 Thread mikej
Yes, I've tried upgrading and reinstalling Xcode. Still the same problem, Mike --~--~-~--~~~---~--~~ 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@googl

[Rails] Controller calling .. ?

2009-07-13 Thread Hemant Bhargava
How can i call a function/method defined in a controller into another view .. ? -- 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

[Rails] Re: How to add default value to text_field_with_auto_complete

2009-07-13 Thread Felix Schäfer
Am 13.07.2009 um 11:40 schrieb Thriving K.: > I can't find the way in rails api of how to add default value in > text_field_with_auto_complete. Anyone know please teach me. I come up with this after 20s of googling: text_field_with_auto_complete foo, bar, :tag_options => { :value => "some d

[Rails] How to add default value to text_field_with_auto_complete

2009-07-13 Thread Thriving K.
I can't find the way in rails api of how to add default value in text_field_with_auto_complete. Anyone know please teach me. Thank you. -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Goog

[Rails] Rails Beacon

2009-07-13 Thread Sreenath Somarajapuram
Hi All, Hope am having a new idea for discussion. We can call it 'Rails Beacon'. Rails provide immortal sessions, they don't expire unless we handle it manually. Some sites handle this by closing the session after a fixed time interval from the last server access, some others keep the sessio

[Rails] Data-only migrations when User model does not store plain text passwords

2009-07-13 Thread steven_noble
Hi all, How do you create a data-only migration for my User model that adds a password salt and encrypted password to the Users table? Also, my model validates the equivalence of :password and :password_confirmation, neither of which are columns in the Users table. I need my data-only migration

[Rails] mailbox model

2009-07-13 Thread Xiahong Gao
Hi everyone, I ran into some problems when modeling mailbox and mails. My code was like: create_table :mailbox do |t| t.integer :user_id # the owner of this mailbox end create_table :mails do |t| t.integer :sender_id t.integer :receiver_id t.string :title t.text :content end class Ma

[Rails] Re: .html/.html.erb/.rhtml to PDF

2009-07-13 Thread Peter De Berdt
On 13 Jul 2009, at 09:55, Sandip Ransing wrote: > I wanted to convert .html file into .pdf. > > is there any rails plugin ?? http://sublog.subimage.com/2007/05/29/html-css-to-pdf-using-ruby-on-rails However, PrinceXML is not free: http://www.princexml.com/purchase/ That said, it works extreme

[Rails] .html/.html.erb/.rhtml to PDF

2009-07-13 Thread Sandip Ransing
Hello All, I wanted to convert .html file into .pdf. is there any rails plugin ?? Thanks, Sandip R~ -- Ruby on Rails Developer http://sandip.sosblog.com http://funonrails.wordpress.com www.joshsoftware.com --~--~-~--~~~---~--~~ You received this message becau

[Rails] custom error pages

2009-07-13 Thread Rabi Khadka
I need to add custom error pages in my site. But i noticed that i need rescue.rb file in lib/action_controller folder. Can somebody help me how to get that file and how to implement custom error pages please -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~-

<    1   2