[Rails] do I need to seperate admin and user area phsically in my file structure ??

2010-07-20 Thread mac
hii guys!! m new to rails. I am about to create a simple CMS application . Do i need to put my files in seperate folders ?? If doing so how to follow rails convention. I am using scaffold to create my admin end . do I need to change my style...I mean do I need to write them on my own ??. Let me e

[Rails] User available query builder + backend

2010-07-20 Thread edoardoz
Hi, I look for a plugin/gem/else for a GUI+backend hooks solution to filter contents in a RoR app. Example: Customer(:id, :name, :vat_number, :state) Address(:id, :customer_id, :state, :city, :street, :phone) User want to select Customers with Customer.state == USA && Address.city == NY. Pretty

Re: [Rails] Re: Model Validations + Urgent

2010-07-20 Thread Colin Law
On 20 July 2010 14:32, Hemant Bhargava wrote: > Colin Law wrote: >> On 20 July 2010 11:07, Hemant Bhargava wrote: >>> Hello all, >>> >>> How to give validation on a field which is not a database column. I mean >>> i am having a file field(upload_resume) in my views. So i want to give >>> validati

[Rails] Re: Creating reflective has_and_belongs_to

2010-07-20 Thread Marnen Laibow-Koser
Marnen Laibow-Koser wrote: > Piotr J. Puczyński wrote: >> Hi I have a question is it possible to create the reflective relation >> with users and friends using has_and_belongs_to. I found this post >> that is partly connected to my: >> http://groups.google.com/group/rubyonrails-talk/browse_thread/t

[Rails] Re: Creating reflective has_and_belongs_to

2010-07-20 Thread Marnen Laibow-Koser
Piotr J. Puczyński wrote: > Hi I have a question is it possible to create the reflective relation > with users and friends using has_and_belongs_to. I found this post > that is partly connected to my: > http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/dff2032301961e2d > > but m

Re: [Rails] Re: Re: Memcache

2010-07-20 Thread Jeffrey L. Taylor
Quoting Yani Yen : > Forgot to mention : > > I had the configuration : > config.cache_store = :mem_cache_store > in my specific environment file. > Still i was getting the above mentioned error > > > Yani Yen wrote: > > Hi, > > > > What i did in my environment.rb file was created an instance of

[Rails] Re: Model Validations + Urgent

2010-07-20 Thread Hemant Bhargava
Colin Law wrote: > On 20 July 2010 11:07, Hemant Bhargava wrote: >> Hello all, >> >> How to give validation on a field which is not a database column. I mean >> i am having a file field(upload_resume) in my views. So i want to give >> validation on it that size should be less then 1mb. I tried >>

Re: [Rails] render :update do |page| issue

2010-07-20 Thread Dave Aronson
On 2010/7/19 Mamadou Touré wrote: > I'm trying to render a partial from my controller, but nothing > happens. What's wrong ? ... > 2 - View: ... >          <% if ! @file_name_arr.nil? %> >              <%= render :partial => "files_list" %> ... > 3 - Partial (_file_list.html.erb) "files" vs

Re: [Rails] Re: Tests Losing Data (factory girl)

2010-07-20 Thread Ants Pants
On 20 July 2010 14:49, Marnen Laibow-Koser wrote: > Ants Pants wrote: > > Solved. Sorry to take up bandwidth :( > > Solved how? Please explain so others can learn. > -- > Posted via http://www.ruby-forum.com/. > > -- > You received this message because you are subscribed to the Google Groups > "

[Rails] Re: Re: Re: Re: Re: Encoding problems with Rails 3 + Ruby 1.9.1 (big surprise)

2010-07-20 Thread Fernando Perez
Rails3 beta4 is still bugged. It should be fixed in RC1: https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/4807-error-encodingundefinedconversionerror-xc3-from-ascii-8bit-to-utf-8 -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed

[Rails] Re: Nested Models not working

2010-07-20 Thread IanJ
> > > class Recipe < ActiveRecord::Base > >  has_many :recipe_parts > >  accepts_nested_attributes_for :recipe_parts > > > class RecipePart < ActiveRecord::Base > >        belongs_to :recipe > >        has_many :recipe_ingredients > >        has_many :ingredients, :through => :recipe_ingredients >

[Rails] Re: Tests Losing Data (factory girl)

2010-07-20 Thread Marnen Laibow-Koser
Ants Pants wrote: > Solved. Sorry to take up bandwidth :( Solved how? Please explain so others can learn. -- 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 ru

Re: [Rails] Re: Associations Problem

2010-07-20 Thread Leonardo Mateo
On Tue, Jul 20, 2010 at 4:46 AM, Colin Law wrote: > On 19 July 2010 22:09, Frederick Cheung wrote: >> >> >> On Jul 19, 9:26 pm, Leonardo Mateo wrote: >> >>> When I do the following in script/console: >>> s = LineItem.last.section (s.id is 21, as is LineItem.last.section_id as >>> well) >>> s.ta

Re: [Rails] Model Validations + Urgent

2010-07-20 Thread Colin Law
On 20 July 2010 11:07, Hemant Bhargava wrote: > Hello all, > > How to give validation on a field which is not a database column. I mean > i am having a file field(upload_resume) in my views. So i want to give > validation on it that size should be less then 1mb. I tried > self.upload_resume and pa

Re: [Rails] Nested Models not working

2010-07-20 Thread Colin Law
On 20 July 2010 12:29, IanJ wrote: > Urgghhh - Newbie help needed to stop me giving up on Rails. > > I have 3 nested models. > Recipe->RecipeParts->RecipeIngredients (to the ingredients index so > maybe 4 levels) > > class Recipe < ActiveRecord::Base >  has_many :recipe_parts >  accepts_nested_att

Re: [Rails] Re: Model Validations + Urgent

2010-07-20 Thread Ants Pants
Virtual attributes in your model? not sure if I understand your problem as I've never done file uploads with Rails. def my_non_db_field ## do something end On 20 July 2010 14:20, Hemant Bhargava wrote: > kannav rajeev wrote: > > are you using any plug in for file field like attechment_fu or

[Rails] Re: Re: Re: Re: Re: Encoding problems with Rails 3 + Ruby 1.9.1 (big surprise)

2010-07-20 Thread Fernando Perez
Hi, It's me again. Now running Rails 3 beta4 and Ruby 1.9.1, and that encoding thing is as I said a gigantic catastrophe! It still does not work! I added default_encoding, and it's as if it doesn't care about it. -- Posted via http://www.ruby-forum.com/. -- You received this message because

[Rails] Re: Model Validations + Urgent

2010-07-20 Thread Hemant Bhargava
kannav rajeev wrote: > are you using any plug in for file field like attechment_fu or > paperclip . if yes please type No i am not using any thing. > > On Tue, Jul 20, 2010 at 3:37 PM, Hemant Bhargava > wrote: >> >> -- >> You received this message because you are subscribed to the Google Group

Re: [Rails] Model Validations + Urgent

2010-07-20 Thread kannav rajeev
are you using any plug in for file field like attechment_fu or paperclip . if yes please type On Tue, Jul 20, 2010 at 3:37 PM, Hemant Bhargava wrote: > Hello all, > > How to give validation on a field which is not a database column. I mean > i am having a file field(upload_resume) in my views. So

[Rails] Re: Tests Losing Data (factory girl)

2010-07-20 Thread Ants Pants
Solved. Sorry to take up bandwidth :( On 20 July 2010 12:36, Ants Pants wrote: > This is a cross post from the fg mailing list but the traffic is very low > there so I thought I'd try here, too. > > While running a test with Cukes/FG, I pre populate a table > (event_categories), run my test and

[Rails] Nested Models not working

2010-07-20 Thread IanJ
Urgghhh - Newbie help needed to stop me giving up on Rails. I have 3 nested models. Recipe->RecipeParts->RecipeIngredients (to the ingredients index so maybe 4 levels) class Recipe < ActiveRecord::Base has_many :recipe_parts accepts_nested_attributes_for :recipe_parts class RecipePart < Act

[Rails] uninitialized constant WillPaginate::LinkRenderer

2010-07-20 Thread Fernando Perez
This is becoming painful. Where the file should be? What should be in it? I am running will_paginate 3.0.pre Here is my current code sitting in initializers/ class WillPaginateRenderer < WillPaginate::LinkRenderer def rel_value(page) "nofollow" end end Thanks for your help, -- Posted vi

Re: [Rails] ajax problem

2010-07-20 Thread Mathew Augustine
what i meant is on clicking the link below in short <%=link_to_remote image_tag("/images/ cricinfoLogo.gif"),{:update > => "changing_layout",:url => { :controller => 'home',:action => > 'change_layout',:value => 'registration'},:method => > :get},:id=>'registr' %> it should replace the div

[Rails] Creating reflective has_and_belongs_to

2010-07-20 Thread Piotr J . Puczyński
Hi I have a question is it possible to create the reflective relation with users and friends using has_and_belongs_to. I found this post that is partly connected to my: http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/dff2032301961e2d but my issue is join table "friends_users"

[Rails] Re: Re: Re: Re: ajax problem

2010-07-20 Thread Tony Augustine
Colin Law wrote: > On 20 July 2010 11:13, Tony Augustine wrote: >>> >>> Is there nothing in development.log after that? >>> >>> Colin >> >> no  sir,  when i check the  error  console its  showing that >> >> "ajax  not  defined" > > Perhaps ajax is not defined then. Have you remembered to in incl

Re: [Rails] Re: Re: Re: ajax problem

2010-07-20 Thread Colin Law
On 20 July 2010 11:13, Tony Augustine wrote: > Colin Law wrote: >> On 20 July 2010 10:39, Tony Augustine wrote: >> Is the puts output appearing? >>> � [4;35;1mSQL (1.7ms) [0m � �[0mSET client_min_messages TO 'notice' [0m >>> >>> >>> Processing HomeController#change_layout (for 127.0.0.1

[Rails] Tests Losing Data (factory girl)

2010-07-20 Thread Ants Pants
This is a cross post from the fg mailing list but the traffic is very low there so I thought I'd try here, too. While running a test with Cukes/FG, I pre populate a table (event_categories), run my test and it passes on a successful failure (duplicate record) When the controller executes ... rend

[Rails] Re: Re: Re: ajax problem

2010-07-20 Thread Tony Augustine
Colin Law wrote: > On 20 July 2010 10:39, Tony Augustine wrote: > >>> Is the puts output appearing? >> � [4;35;1mSQL (1.7ms) [0m � �[0mSET client_min_messages TO 'notice' [0m >> >> >> Processing HomeController#change_layout (for 127.0.0.1 at 2010-07-20 >> 14:07:05) [GET] >> �Parameters: {"val

[Rails] Model Validations + Urgent

2010-07-20 Thread Hemant Bhargava
Hello all, How to give validation on a field which is not a database column. I mean i am having a file field(upload_resume) in my views. So i want to give validation on it that size should be less then 1mb. I tried self.upload_resume and params[:upload_resume] but both are not working. So guys, l

Re: [Rails] Re: Re: ajax problem

2010-07-20 Thread Colin Law
On 20 July 2010 10:39, Tony Augustine wrote: > Colin Law wrote: >> Could you not top post please, it makes it more difficult to follow >> the thread, and easier to forget to reply to something, for example >> you did not reply to my question asking what is in the log. >> >> See further question be

[Rails] Re: Re: ajax problem

2010-07-20 Thread Tony Augustine
Colin Law wrote: > Could you not top post please, it makes it more difficult to follow > the thread, and easier to forget to reply to something, for example > you did not reply to my question asking what is in the log. > > See further question below > > On 20 July 2010 10:27, Tony Augustine wrot

[Rails] Re: Re: ajax problem

2010-07-20 Thread Tony Augustine
Colin Law wrote: > Could you not top post please, it makes it more difficult to follow > the thread, and easier to forget to reply to something, for example > you did not reply to my question asking what is in the log. > > See further question below > > On 20 July 2010 10:27, Tony Augustine wrot

Re: [Rails] Re: many to many relations

2010-07-20 Thread Colin Law
On 20 July 2010 10:30, Sampath Munasinghe wrote: > Anybody having good tutorial for many to many relationships? I need to do > following. > categories can have many items > item can belongs many categories > i need to save all the categories and items from single form. > please help me. You do no

Re: [Rails] Re: ajax problem

2010-07-20 Thread Colin Law
Could you not top post please, it makes it more difficult to follow the thread, and easier to forget to reply to something, for example you did not reply to my question asking what is in the log. See further question below On 20 July 2010 10:27, Tony Augustine wrote: > what i meant is   on click

Re: [Rails] Re: many to many relations

2010-07-20 Thread Sampath Munasinghe
Anybody having good tutorial for many to many relationships? I need to do following. categories can have many items item can belongs many categories i need to save all the categories and items from single form. please help me. -- You received this message because you are subscribed to the Goog

[Rails] Re: ajax problem

2010-07-20 Thread Tony Augustine
what i meant is on clicking the link below in short <%=link_to_remote image_tag("/images/ cricinfoLogo.gif"),{:update > => "changing_layout",:url => { :controller => 'home',:action => > 'change_layout',:value => 'registration'},:method => > :get},:id=>'registr' %> it should replace the di

Re: [Rails] ajax problem

2010-07-20 Thread Colin Law
On 20 July 2010 09:44, Tony Augustine wrote: > Hi  i created         an  application  which using  ajax method,   but > unfortunately  ma application is not   working this is  ma  view page in > which i  used ajax. here on clickint the links it  should replace the > div "changing_layout" > on the

[Rails] ajax problem

2010-07-20 Thread Tony Augustine
Hi i created an application which using ajax method, but unfortunately ma application is not working this is ma view page in which i used ajax. here on clickint the links it should replace the div "changing_layout" on the basis of values passed to the controller but for me i

Re: [Rails] Re: Association count sorting

2010-07-20 Thread Michael Pavling
On 20 July 2010 04:14, badnaam wrote: > Here is *AN* answer if someone else runs into this.. Your solution may certainly work... but is a bit "imperative" in coding terms, and does introduce an n+1 problem. Rails offers a feature called "counter_cache" on associations - which gives you a column

Re: [Rails] Association count sorting

2010-07-20 Thread Colin Law
On 20 July 2010 03:22, badnaam wrote: > I have 3 models GrandPa, Pa, Kid > > GrandPa => has_many :pas > Pa => has_many kids > > When I list GrandPa I would like to present the following > > * > 1 - GrandPa_Name > > 2 - List of Pas sorted by the number ki

Re: [Rails] named_scope returns Array -- find returns error?

2010-07-20 Thread Colin Law
On 19 July 2010 23:35, Seth Willits wrote: > From the documentation: > > > -- > class Shirt < ActiveRecord::Base >    named_scope :red, :conditions => {:color => 'red'} > end > > Unlike Shirt.find(...), however, the object returned by Shirt.red is not > an Array; it res

[Rails] Re: Jruby or Ruby(1.9.1) with Rails for lots of Java Backends

2010-07-20 Thread LiTE
http://www.javaworld.com/javaworld/jw-07-2006/jw-0717-ruby.html On 20 Lip, 01:25, YoonSung Hong wrote: > Hello, > > I'm working on a project that requires a lot of web triggered java > applications. For instance, when a user click a search button, I call > java from Rails to do the heavy weight.

Re: [Rails] Re: Strange Error undefined method `show' for # see no

2010-07-20 Thread Colin Law
On 19 July 2010 23:08, rubybox wrote: > thanks for the comments so far, > I only did a git commit on every deploy I now will do it after each > few changes.. > Removed some stuff from the app I added before the error occured still > same error > This is my full trace/error report > > NoMethodError

[Rails] Re: Re: Memcache

2010-07-20 Thread Yani Yen
Forgot to mention : I had the configuration : config.cache_store = :mem_cache_store in my specific environment file. Still i was getting the above mentioned error Yani Yen wrote: > Hi, > > What i did in my environment.rb file was created an instance of memcache > and assign it to a constant: >

Re: [Rails] Re: Associations Problem

2010-07-20 Thread Colin Law
On 19 July 2010 22:09, Frederick Cheung wrote: > > > On Jul 19, 9:26 pm, Leonardo Mateo wrote: > >> When I do the following in script/console: >> s = LineItem.last.section (s.id is 21, as is LineItem.last.section_id as >> well) >> s.target >> >> I get the Section instance, and the logger shows n

[Rails] Re: Re: Memcache

2010-07-20 Thread Yani Yen
Hi, What i did in my environment.rb file was created an instance of memcache and assign it to a constant: CACHE = MemCache.new('127.0.0.1') and then in my code something like this: def data_cache(key) unless output = CACHE.get(key) output = yield CACHE.set(key, output, 1.hour) end

<    1   2