[Rails] Re: .ago

2009-03-28 Thread CFC
m = 1.years.ago.strftime("%b") #=> Mar m = 1.years.ago.strftime("%B") #=> March On Sat, Mar 28, 2009 at 3:14 PM, Sijo Kg wrote: > > Hi > I have > m = 1.year.ago.mon #This I get 3 > > But how to get name of month ie March from above? > > Thanks in advance > Sijo > -- > Posted via h

[Rails] Re: any body please help me

2009-03-10 Thread CFC
Downgrade your Ruby to Ruby 1.8.6 On Tue, Mar 10, 2009 at 11:59 PM, Hamid Raza < rails-mailing-l...@andreas-s.net> wrote: > > High Priority Problem , when uploading image > Posted by Hamid Raza (hamidraza) > on 10.03.2009 15:55 > > i m uploading an image and found following error , plz n e buddi

[Rails] Re: How can I set default order in Model.rb?

2009-03-09 Thread CFC
Thank you, Philip :) On Tue, Mar 10, 2009 at 11:32 AM, Philip Hallstrom wrote: > > > On Mar 9, 2009, at 8:22 PM, CFC wrote: > > > Hi, all > > How can I set a default order in a model.rb? > > > > For an instance, I have a model called "Bulletin"

[Rails] Re: If else not working?

2009-03-09 Thread CFC
Cause it didn't return any object. so you must check the @oLogin first. On Tue, Mar 10, 2009 at 11:11 AM, Chris Gunnels < rails-mailing-l...@andreas-s.net> wrote: > > I get the following error when I try to login into my admin back end: > > NoMethodError in MemberController#index > > You have a n

[Rails] How can I set default order in Model.rb?

2009-03-09 Thread CFC
Hi, all How can I set a default order in a model.rb? For an instance, I have a model called "Bulletin" I want all query with 'find' method return records by ordered. [code] Bulletin.all #=> Same as: Bulletin.find(:all, {:order => "publish_at DESC"}) [/code] Should I write a method to do that? Or

[Rails] Re: Best Rails editor

2009-03-09 Thread CFC
o starting mysql server > on a mac can be a . > I do perfere netbeans, because of accelent integration with subversion > and mysql. > > regards > svend > > On Mar 9, 3:57 am, CFC wrote: > > Your solution: Click me <http://www.apple.com/mac/> and Click > > me&

[Rails] Re: "no such file to load -- sqlite3" Rails

2009-03-08 Thread CFC
C:\> gem i sqlite3-ruby On Mon, Mar 9, 2009 at 10:57 AM, Cyberg Cg wrote: > > Followed things in this email thread but still struggling with this > issue. > > I downgraded from sqlite3 version from 1.2.2 to 1.2.1. > > I am running WEBRick installed as part of Ruby downloaded from the > forge. I

[Rails] Re: Best Rails editor

2009-03-08 Thread CFC
Your solution: Click me and Click me :) On Mon, Mar 9, 2009 at 2:19 AM, bramu...@gmail.com wrote: > > Hi All, > > I am new to Rails, I was searching for the best Rails IDE for doing > my project. I found Aptana with RadRails, which is very hea

[Rails] Re: About before_* callbacks

2009-03-07 Thread CFC
Okay, I seeThanks, Matt. On Fri, Mar 6, 2009 at 12:31 AM, Matt Jones wrote: > > > > On Mar 4, 11:13 pm, CFC wrote: > > Hi > > I have an problem about before_* callbacks. > > > > I have a model named: Event > > And I don't want anyone to destroy or

[Rails] Re: counter cache problem

2009-03-07 Thread CFC
Gallery.rb has_many :images, :counter_cache => true On Sat, Mar 7, 2009 at 8:23 PM, pankaj wrote: > > Here is the problem > There is a gallery model and image model > gallery has many images > gallery has images_count. > > When I change image from one gallery to another i have to update the > co

[Rails] Re: About before_* callbacks

2009-03-05 Thread CFC
I think the only way to do this is write the code in destroy & update action :( If one callback return false, then it will interrupt any actions after the callback. :( Thank you, Fred and Robert :D On Thu, Mar 5, 2009 at 5:35 PM, Frederick Cheung wrote: > > > > On Mar 5, 6:1

[Rails] Re: About before_* callbacks

2009-03-04 Thread CFC
If I set read-only to the model, then I can't create any event anymore :( I just want to block anyone to update/destroy records, but I need to create records :) On 3月5日, 下午1時12分, Robert Walker wrote: > Billy Hsu wrote: > > I have a model named: Event > > And I don't want anyone to destroy or upd

[Rails] About before_* callbacks

2009-03-04 Thread CFC
Hi I have an problem about before_* callbacks. I have a model named: Event And I don't want anyone to destroy or update any records in Event model. So: [code] class ActiveRecord::Base before_destroy :log_illegal_operations before_update :log_illegal_operations private def log_illegal_o

[Rails] Re: How can I set Rails user name?

2009-03-02 Thread CFC
Start your rails server by other user. On Tue, Mar 3, 2009 at 9:12 AM, Zhao Yi wrote: > > I use root to start the Rails server. So all the operations on this > server will be root permission. For example, create a file in the server > disk. How can I change a user? > -- > Posted via http://www.ru

[Rails] Re: Validate field not in model?

2009-02-26 Thread CFC
define it as a getter and setter. On Fri, Feb 27, 2009 at 10:49 AM, Mike C wrote: > > I want to validate a field in my form that's not an attribute in the > model. How do I do this? > > > -- TWRUG Blog: http://blog.rubyonrails.org.tw CFC on Rails: http://zusocfc

[Rails] Re: javascript using jQuery.js and prototype.js doesnt work 2get

2009-02-26 Thread CFC
ails-mailing-l...@andreas-s.net> wrote: > > > >> >> > >> below is my rhtml file...and i followed the sequence given below... My > >> section_title(params[:controller]) %> : <% end %>DashGo > >> > >> > >> > CFC on R

[Rails] Re: Store find output in a new array

2009-02-26 Thread CFC
_fees" in a new array. > > like this... > > ticket_fee = ["2", "3", "1"] > > How can i do this(newbie) > > Thanks..remco > -- > Posted via http://www.ruby-forum.com/. > > > > -- TWRUG Blog: http://blog.rubyonrails.org.tw C

[Rails] Re: passing objects to methods

2009-02-26 Thread CFC
tried the following: > > url = "<%= url_for( ., :action => 'search', :myobject => > #...@myobject} . > > but it didn't work. > > > Thanks in advance! > -- > Posted via http://www.ruby-forum.com/. > > > > -- TWRUG Blog: http

[Rails] Re: javascript using jQuery.js and prototype.js doesnt work 2get

2009-02-25 Thread CFC
_include_tag "jquery.color.js" %> ><%= javascript_include_tag "scripts" %> > >jQuery.noConflict(); > ><%= javascript_include_tag 'prototype' %> > > > > ><%= yield %> > ><%= render :partial =&

[Rails] Re: javascript using jQuery.js and prototype.js doesnt work 2get

2009-02-25 Thread CFC
t; > bt of no use. problem remains the same... > > any suggestions are greatly appriciated. > > thankx.. > -- > Posted via http://www.ruby-forum.com/. > > > > -- TWRUG Blog: http://blog.rubyonrails.org.tw CFC on Rai

[Rails] Re: How to resolve JavaScripts Conflict

2009-02-25 Thread CFC
osted via http://www.ruby-forum.com/. > > > > -- TWRUG Blog: http://blog.rubyonrails.org.tw CFC on Rails: http://zusocfc.blogspot.com Only two surfaces of a box: http://blog.pixnet.net/zusocfc --~--~-~--~~~---~--~~ You received this message because you are subscribed to t

[Rails] Re: using a controller method in model

2009-02-07 Thread CFC
> use is_ok? > > > > > -- TWRUG Blog: http://blog.rubyonrails.org.tw CFC on Rails: http://zusocfc.blogspot.com Only two surfaces of a box: http://blog.pixnet.net/zusocfc --~--~-~--~~~---~--~~ You received this message because you are subscribed to

[Rails] Re: confusing singleton resource

2009-02-07 Thread CFC
with me? > -- > Posted via http://www.ruby-forum.com/. > > > > -- TWRUG Blog: http://blog.rubyonrails.org.tw CFC on Rails: http://zusocfc.blogspot.com Only two surfaces of a box: http://blog.pixnet.net/zusocfc --~--~-~--~~~---~--~~ You received this m

[Rails] Re: Adding "id='xyz' " to a form_tag

2009-02-04 Thread CFC
;my_controller', :action => 'my_action' do %> > ><% end %> > > This compiles and runs ok with no errors, but it treats the ID= as a > parameter for my URL - not what I want. Is there a way to use > form_tag to generate HTML similar to

[Rails] Re: after_save -- stack level too deep

2009-01-17 Thread CFC
s in with one of the model's validators it > works just fine, but that's not the right way to do this... > > I don't see how I'm recursing here, so any help would be appreciated! > > Thanks! > > > -- TWRUG Blog: http://blog.rubyonrails.

[Rails] Re: Session[:user]

2009-01-17 Thread CFC
when I call self.current_user = User.authenticate(...) > > from somewhere else and I redirect.. I lose my session variable. How > > could this happen? > > -- > Posted via http://www.ruby-forum.com/. > > > > -- TWRUG B

[Rails] Re: How to set homepage in Rails

2008-12-30 Thread CFC
w can I do setting from rails ,please? > > Thanks. > > Cruise > -- > Posted via http://www.ruby-forum.com/. > > > > -- TWRUG Blog: http://blog.rubyonrails.org.tw CFC on Rails: http://zusocfc.blogspot.com Only two surfaces of a box: http://blog.pixnet.net/zusocfc

[Rails] Re: map.root

2008-12-19 Thread CFC
tion=>'index' > > Thanks in advance > Sijo > -- > Posted via http://www.ruby-forum.com/. > > > > -- TWRUG Blog: http://blog.rubyonrails.org.tw CFC on Rails: http://zusocfc.blogspot.com Only two surfaces of a box: http://blog.pixnet.net/zusocfc --~--~---

[Rails] Re: Rails2.2.2, is it a bug?

2008-12-18 Thread CFC
release_path(@release) %> | > <%= link_to 'Back', releases_path %> > > it is good .but when i changed <%=h @release.movie_id %> to < > %=h @release.movie.title %>, when i called show action , it > reported a error :"Attempt to call priva

[Rails] Re: Rails2.2.2, is it a bug?

2008-12-17 Thread CFC
"Attempt to call private method" --- > > > format > > > > See: <http://wiki.rubyonrails.org/rails/pages/ReservedWords> -- the > > "reported to cause trouble" section includes 'format'. > > > > You

[Rails] Re: Ruby Arrays - Passing arrays from a function possible?

2008-12-10 Thread CFC
pass those product attributes into the add_item > function properly? Or, maybe you know of a different way I should I > approach this? > -- > Posted via http://www.ruby-forum.com/. > > > > -- TWRUG Blog: http://blog.rubyonrails.org.tw

[Rails] Re: I am New to Ruby..Please Help me ON start

2008-12-10 Thread CFC
> > -- TWRUG Blog: http://blog.rubyonrails.org.tw CFC on Rails: http://zusocfc.blogspot.com Only two surfaces of a box: http://blog.pixnet.net/zusocfc --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby

[Rails] Re: I am New to Ruby..Please Help me ON start

2008-12-09 Thread CFC
I know. I never use socket parameter when I developed on Windows :P On Wed, Dec 10, 2008 at 2:30 PM, Air *** <[EMAIL PROTECTED]>wrote: > > he was using window xp > -- > Posted via http://www.ruby-forum.com/. > > > > -- TWRUG Blog: http://blog.rubyonra

[Rails] Re: I am New to Ruby..Please Help me ON start

2008-12-09 Thread CFC
> > change socket to "socket = C:/www/tmp/mysql.sock" > > -- > Posted via http://www.ruby-forum.com/. > > > > -- TWRUG Blog: http://blog.rubyonrails.org.tw CFC on Rails: http://zusocfc.blogspot.com Only two surfaces of a box: http://blog.pixnet.net/zusocfc --~-

[Rails] Re: I am New to Ruby..Please Help me ON start

2008-12-09 Thread CFC
/production.sqlite3 > pool: 5 > timeout: 5000 > > > Is all correct?? > -- > Posted via http://www.ruby-forum.com/. > > > > -- TWRUG Blog: http://blog.rubyonrails.org.tw CFC on Rails: http://zusocfc.blogspot.com Only two surfaces of a box: http://blog.pixnet.

[Rails] Re: I am New to Ruby..Please Help me ON start

2008-12-09 Thread CFC
production: > adapter: sqlite3 > database: db/production.sqlite3 > pool: 5 > timeout: 5000 > > > I didnt install Mysql in my PC... > > -- > Posted via http://www.ruby-forum.com/. > > > > -- TWRUG Bl

[Rails] Re: mac vs windows - why is windows soooo slow?

2008-12-09 Thread CFC
2.2.2. Sigh... > -- > Posted via http://www.ruby-forum.com/. > > > > -- TWRUG Blog: http://blog.rubyonrails.org.tw CFC on Rails: http://zusocfc.blogspot.com Only two surfaces of a box: http://blog.pixnet.net/zusocfc --~--~-~--~~~---~--~~ You re

[Rails] Re: calendar_date_select_includes not found

2008-12-08 Thread CFC
includes %> # it's erroring on this line. It > doesn't know where to find calendar_date_select_includes > > Even though calendar_date_select is in my gems directory my app isn't > picking it up. How do I debug something like this? And does anybody > have any suggestions for

[Rails] Re: installing ruby gem mysql

2008-12-07 Thread CFC
ry/Ruby/Gems/1.8/gems/mysql-2.7 > for inspection. > Results logged to /Library/Ruby/Gems/1.8/gems/mysql-2.7/gem_make.out > > Any help is appreciated. > Thanks > -- > Posted via http://www.ruby-forum.com/. > > > > -- TWRUG

[Rails] I got a problem when I run "gem clean"

2008-11-27 Thread CFC
I bought a new Mac (:P) in these days, and I found that Leopard built- in rails 1.2.6 But it's rails 2.2.2 right now, so I upgraded Rubygems before I upgraded rails.. and after I upgraded Rubygems and Rails... I run "gem clean" and got the error message: bash-3.2# gem clean Cleaning up installed

[Rails] Re: 'Admin::UsersHelper' is already used problem

2008-10-23 Thread CFC
in application.rb comment "helper :all" and run again. Like this: class ApplicationController < ActionController::Base #helper :all # include all helpers, all the time end On 10月8日, 上午5時51分, comopasta Gr <[EMAIL PROTECTED]> wrote: > Hi, > > I'm getting the next error: > > The name 'Admin::Use