[Rails] Re: link_to :method => :delete doesn't?

2011-01-30 Thread eka
What about this workaround: Define an additional route match 'localities/:id/delete' => 'localities#destroy', :as => :delete_locality Thanks Ernst -- 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 rub

[Rails] Re: link_to :method => :delete doesn't?

2011-01-30 Thread eka
Hi I am a newbie, So I followed the suggestions by Chris Mear and Fearless Fool but still delete gets routed to show! However this works: curl "http://10.0.1.33:3000/localities/1"; -X DELETE Resoure locality was created with rails generate scaffold ... Thanks Ernst -- You received this messag

[Rails] Re: link_to :method => :delete doesn't?

2011-01-30 Thread eka
Hi, I am new to rails and was very pleased to find this thread. After reinstalling ruby with rvm ( ruby-1.9.2-p0 [ x86_64 ]) installing rails 3.0.3 installing gem 'jquery-rails' rails generate jquery:install rails generate scaffold locality name:string type:string parent_id:string There is st

[Rails] Re: Access parent object instance variable

2011-01-30 Thread Frederick Cheung
On Jan 31, 12:29 am, "Ellicks M." wrote: > > So, essentially on creation of a RollingEvent I'd be passing in a > reference to the parent Event? That is how things work in ruby > Would I have to make a method for every single data member like so: > >   def amount >     @parent_event.amount >   en

[Rails] Strange rake error with config.cache_classes

2011-01-30 Thread tashfeen.ekram
when i run rake tasks, i run into a strange problem when running it in production mode. it loads all of the files in the directory app/ runners/cron. when i run the rake task with config.cache_classes set to true (as it is set in environment/production.rb) then it seems to load those files in that

Re: [Rails] Instal MySQL gem problem

2011-01-30 Thread dan
André Freitas 2011?1?31? 2:06 Hi dear members, I'm having a problem in installing Mysql Gem on cPanel. I searched the web for a solution, but I didn't get relevant solutions to solve this issue. The problem picture is in this document http://bit.ly/dM3VM

[Rails] Re: Access parent object instance variable

2011-01-30 Thread Ellicks M.
> Are you under the assumption that > > parent = Event.new > > rolling_event_one.parent = parent > rolling_event_two.parent = parent > rolling_event_three.parent = parent > > creates 3 copies of parents? It doesn't (unless you've written parent= > to store a copy of parent) > > Fred Hi Fred, So,

[Rails] Re: Access parent object instance variable

2011-01-30 Thread Frederick Cheung
On Jan 30, 10:27 pm, "Ellicks M." wrote: > > I thought grabbing an instance of an object was probably a bad idea. > > If the event occurrences (RollingEvents as they're called) actually > store their parent event then they would not be any better than storing > multiple copies of the event itself.

[Rails] Re: Access parent object instance variable

2011-01-30 Thread Ellicks M.
> Why do event occurrences not store their parent event rather than the > object_id? Whatever you do ObjectSpace is really best avoided. I'm > still not sure why this is better/more expressive than calculating > them on the fly - you're clearly able to calculate the occurrences > pragmatically, so

[Rails] Re: Access parent object instance variable

2011-01-30 Thread Frederick Cheung
> > Hi Fred, > > Mainly speed/performance but these 'events' are looped through all over > the show.  I think it'd be impractical to write a method for each unique > set of criteria: > >   er = get_eventroster >   the_date = "2010-12-31".to_date > >   er.allevents.select{|e| e.calendar_id == 20135

[Rails] attempting to update to ruby 1.9.2 in cygwin on Win 7 x64 with 1.8.7 installed

2011-01-30 Thread Cappy Popp
Newbie here, very confused. Installed rails to cygwin using 1.8.7 and rails 3.0.3. Everything worked fine. Wanted to test out RubyMine 3.0.1 IDE debugger but can't run debugger because 'ruby-debug-base' gem not installed. Supposedly only can install on ruby 1.9+ based on forum posts I read. So,

[Rails] Re: Access parent object instance variable

2011-01-30 Thread Ellicks M.
justinbaker wrote in post #978517: > First off..this isn't valid ruby. > > class EventRoster{ > @events = [] > @event_occurrences = [] > } > > try > class EventRoster > def initialize > @events = [] > @event_occurrences = [] > end > end Thank you, Justin, for your valued input. Un

[Rails] Re: Access parent object instance variable

2011-01-30 Thread Ellicks M.
Frederick Cheung wrote in post #978493: > On Jan 30, 12:51am, "Ellicks M." wrote: >> I want to be able to loop over all the event_occurrences and access the >> data of the parent event. At the moment I'm doing this via something >> like: >> >> ObjectSpace._id2ref(@parent_event_object_id).title >>

[Rails] How to create this link

2011-01-30 Thread Yan Bernacki
Hello I have a problem with Ajax. I have some method who returns link_to some_path, :anchor => "anchor" and replace content area on page. At start a have this: browser path => /help Help <%= link_to "Downloads", download_page_path, :remote => true %> I click link and got this: browser path =>

Re: [Rails] Re: Application Helper Problem

2011-01-30 Thread Rob Biedenharn
On Jan 30, 2011, at 2:05 PM, Jeff Miller wrote: ... content_tag("div", "#{label} #{form_field}".html_safe!, :class => "form_row") ... gives me the error: You can't call html_safe! on a String. Obviously I'm doing this wrong... where should I place html_safe! ? Thanks, - Jeff Miller It's j

[Rails] Re: Application Helper Problem

2011-01-30 Thread Jeff Miller
Ah! I got it. Thanks for pointing me in the right direction! -- 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-talk@googlegroups.com. To unsubscrib

[Rails] Re: Application Helper Problem

2011-01-30 Thread Jeff Miller
... content_tag("div", "#{label} #{form_field}".html_safe!, :class => "form_row") ... gives me the error: You can't call html_safe! on a String. Obviously I'm doing this wrong... where should I place html_safe! ? Thanks, - Jeff Miller -- Posted via http://www.ruby-forum.com/. -- You receiv

[Rails] long-decimal

2011-01-30 Thread Karl Brodowsky
For all of you guys who like to work with finance applications: I have added a release 1.00.01 of the library long-decimal to rubyforge.org and rubygems.org, which has been tested for JRuby, Ruby 1.8, Ruby 1.9 and Rubinius. This adds a type for doing calculations with fixed point numbers: +, -,

[Rails] Instal MySQL gem problem

2011-01-30 Thread André Freitas
Hi dear members, I'm having a problem in installing Mysql Gem on cPanel. I searched the web for a solution, but I didn't get relevant solutions to solve this issue. The problem picture is in this document http://bit.ly/dM3VMT. Thanks for your attention. Regards, André. -- You received this messa

[Rails] Design/Implementation question on record (de)activation and view state preserving

2011-01-30 Thread Daniel
What I want to achieve: I have a model which has records that can either be activated or deactivated. I want to show these records in a view. Based on the state of a checkbox, the view should show either all activated records or all records. Furthermore I would like to add a link to dis/enable a r

[Rails] Re: Application Helper Problem

2011-01-30 Thread Frederick Cheung
On Jan 30, 6:40 pm, Jeff Miller wrote: > Hello, >   I'm trying to follow a book (www.RailsSpace.com). The book was made > with an older version of Rails, but I'm using Rails 3. I've got a > snippet of code in my application helper that is supposed to add a text > field... It does, but it comes o

[Rails] Application Helper Problem

2011-01-30 Thread Jeff Miller
Hello, I'm trying to follow a book (www.RailsSpace.com). The book was made with an older version of Rails, but I'm using Rails 3. I've got a snippet of code in my application helper that is supposed to add a text field... It does, but it comes out as escaped TEXT on the webpage. Here is my helper

Re: [Rails] Re: newbie: defined?(Rails)

2011-01-30 Thread tom
ok, thx for ur insight appreciate it On Sat, Jan 29, 2011 at 3:03 PM, Frederick Cheung < frederick.che...@gmail.com> wrote: > > > On Jan 29, 6:06 pm, tom wrote: > > ok, that makes sense. but where is that variable being 'declared' and or > > set? > > Somewhere early in the Rails initialization

[Rails] Re: need help on rails route

2011-01-30 Thread justinbaker
Is it in [rails_root]/public/blog? I would recommend reading this http://codelikezell.com/deploying-wordpress-with-rails-on-passenger. It should be exactly what you're looking for. On Jan 29, 4:23 am, nicolas wrote: > Hi Everyone > > I have a site that it is up and running. Now i need to include

[Rails] Re: Mysql issue with rails 3 and Ruby 1.9.2

2011-01-30 Thread justinbaker
Do you have Mysql installed? Not the gem, or the dll, but mysql.exe? If you have it installed, check your environment PATH. In cmd, try `mysql`. If it gives you `mysql is not recognized...`, then you need to install it. On Jan 30, 6:18 am, Selvaraj Subbaian wrote: > Hello, > > I am trying to ins

[Rails] Re: Access parent object instance variable

2011-01-30 Thread justinbaker
First off..this isn't valid ruby. class EventRoster{ @events = [] @event_occurrences = [] } try class EventRoster def initialize @events = [] @event_occurrences = [] end end On Jan 29, 7:51 pm, "Ellicks M." wrote: > Hi there, > > I have a class which looks like this: > > class E

[Rails] Re: Find User by Token

2011-01-30 Thread justinbaker
The problem is in the routes. The first match found will be what that url is routed to, so when you declared resources :users, it defines / users/:id to match users#show. Try this: Reg::Application.routes.draw do resources :users, :except => [:show] root :to => "users#new" match "/users/:

Re: [Rails] Mysql issue with rails 3 and Ruby 1.9.2

2011-01-30 Thread Zerony Zhao
If you sees that you did not set PATH properly, add mysql directory to %PATH%. On command line, you should be able to run mysql, if you can't, dbconsole won't be able to run. On Sun, Jan 30, 2011 at 5:18 AM, Selvaraj Subbaian wrote: > Hello, > > I am trying to install rails and ruby with latest v

[Rails] Re: Mysql issue with rails 3 and Ruby 1.9.2

2011-01-30 Thread Alpha Blue
In your Gemfile place: gem 'mysql' In your database.yml file make sure you've changed mysql2 to mysql. Make sure that you are using the correct version of mysql and the correct dll based on 32 bit or 64 bit. Currently, 64 bit has numerous issues and you should just install the 32 bit ve

[Rails] Re: beginner question: database relationships

2011-01-30 Thread Alpha Blue
Alexander Farley wrote in post #978480: > That helps a lot. To clarify, I am not necessarily looking to create > seed data upon creation of a User; just trying to figure out how to > "link" the creation of the two resources. The create_model method sounds > about right. > > Anyway, your info gives

Re: [Rails] Find User by Token

2011-01-30 Thread kracekumar ramaraju
Hello Can i have your view source code(I mean view in mvc). -- 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 rubyonrail

Re: [Rails] Find User by Token

2011-01-30 Thread kracekumar ramaraju
Hello Instead of this def show @user = User.find(params[:token]) end Try def show @user=User.find_by_id(params[:token]) end If id is the column in development table if you want to find details by username you can use @user=User.find_by_username(params[:token]) In general @user=User.fin

[Rails] Re: Access parent object instance variable

2011-01-30 Thread Frederick Cheung
On Jan 30, 12:51 am, "Ellicks M." wrote: > I want to be able to loop over all the event_occurrences and access the > data of the parent event.  At the moment I'm doing this via something > like: > >    ObjectSpace._id2ref(@parent_event_object_id).title > > but this is sometimes returning RangeEr

[Rails] Re: rails 2.1.2 to rails 2.2.2 now I get mysql issues

2011-01-30 Thread Selvaraj Subbaian
Jason S. wrote in post #955144: > +1 - copying from the instant rails download link to ruby/bin worked for > me: > > Rails 3.0.1 > Ruby 1.8.7 (and Ruby 1.9.2, works on both) > MySQL 5.5 x64 > Windows 7 x64 > NetBeans IDE > > Thanks! > Another Jason S. ohhh.. long lasting issue..now I am facing thi

[Rails] Re: Bug/Feedback/Suggestion report gem?

2011-01-30 Thread Heinz Strunk
Since I couldn't find any gem I decided to go with UserEcho. -- 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-talk@googlegroups.com. To unsubscrib

[Rails] Mysql issue with rails 3 and Ruby 1.9.2

2011-01-30 Thread Selvaraj Subbaian
Hello, I am trying to install rails and ruby with latest version. Every thing is ok, but mysql is not not working. I followed all the google links. the whole day is failed. any idea.. When I try to use dbconsole, I am getting following error. Couldn't find database client: mysql, mysql5. Check y

[Rails] Re: beginner question: database relationships

2011-01-30 Thread Alexander Farley
That helps a lot. To clarify, I am not necessarily looking to create seed data upon creation of a User; just trying to figure out how to "link" the creation of the two resources. The create_model method sounds about right. Anyway, your info gives me plenty to read up on for now. Thanks again A

[Rails] Find User by Token

2011-01-30 Thread camgill
Hi, I have spent the last couple of hours Googling and trying any thing that i think will work but i haven't any luck. :( Here is an outline of what I am trying to do. I want to show a use there info by going to "http://localhost:3000/ users/5c6e957b523f931fdda3e9922b680c2d868cf44b" (random toke

[Rails] Vacancy Senior Ruby on Rails Developer (Kyiv)

2011-01-30 Thread Hr
Our project is a service for C2C and B2C segments of the global online market. It's orientation is a wide segment of customers – users of online markets, classifieds, auctions, etc. Project is designed for the worldwide usage, starting with the biggest markets: USA, China and Western Europe. Our