[Rails] Temporal calculations and timezone corrections

2010-04-12 Thread Marcelo de Moraes Serpa
Hello all, I wonder how you guys handle subscription-cycles (and or billing cycles) and time-zones -- well, not only limited to billing-cycles but to any other temporalish feature such as trials, expiration dates etc. One thing that just came to my mind is if, for example, a user that signs up fo

Re: [Rails] Re: Re: Customized Route Resource Helper URLs (to not use '

2010-04-12 Thread Anthony
what useful it has 2010/4/13 Seth Willits > Aha! That was even better than I hoped for. to_param is exactly what I > needed. Thanks > -- > 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

Re: [Rails] Tracking User Behaviour

2010-04-12 Thread Anthony
use google analytics 2010/4/13 David > Are there any good log analyzers that help you see user behavior, like > tracking user clicks, and not just analyze for performance? > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post

Re: [Rails] Re: NESTED routes?

2010-04-12 Thread Anthony
yeah ,very good 2010/4/13 David Zhu > nvm heres a great link-- > http://weblog.jamisbuck.org/2007/2/5/nesting-resources > > Excellent explanation, worked for me at least :D > > On Apr 12, 8:35 pm, David Zhu wrote: > > Hey everyone, > > > > What if i need to do this in my routes.rb-- > > > > a h

Re: [Rails] Re: Problem with basic routing

2010-04-12 Thread Anthony
maybe the config is errored this article maybe help you http://www.webmasterwords.com/ruby-rails-mongrel-apache-easy 2010/4/12 Benchips > > The app folder is located on the server machine, in /usr/local (this > is a Fedora installation). I have a root access to the server, but it > has been

[Rails] Re: getting a duplicate record with has_many and update_attributes

2010-04-12 Thread Bob Smith
I would have many records that match only the household_id that way. One for each month and year. I'm trying to get the record for this month. But that part works OK. The problem is with creating people objects. It works fine after the record is created with the correct records being changed, added

Re: [Rails] How to check if a parent has children?

2010-04-12 Thread Paul Jonathan Thompson
Thanks Anthony, Did a little more homework and decided to use: unless @client.line_items.blank? as .blank? will not bomb on a nil condition and .empty? will. But thanks very much for pointing me in the right direction. Regards, Paul Thompson On 13 April 2010 14:16, Anthony Crumley wrote: >

Re: [Rails] Re: Nested forms: Can you access the object from within fields_for?

2010-04-12 Thread John Grimes
That works perfectly, thanks! Just to clarify for anyone else reading this, code such as this should work: <% form_for @user do |f| %> <%= f.error_messages %> <% f.fields_for :friends do |friends| %> <%= friends.object.name %> <%= friends.text_field :relationship_to_y

Re: [Rails] Re: Clearing a plugins instance variables on each request

2010-04-12 Thread Anthony Crumley
Sean, I think flash.now would be fine for objects because it is only there during the request and is not persisted. Anthony Crumley http://commonthread.com On Mon, Apr 12, 2010 at 9:21 PM, SeanWalberg wrote: > It would seem to do what I'm looking for, though was the flash meant > for objects?

[Rails] Re: Clearing a plugins instance variables on each request

2010-04-12 Thread SeanWalberg
It would seem to do what I'm looking for, though was the flash meant for objects? Either way, I'll look at the implementation to see if I can use similar methods. Thanks, Sean On Apr 12, 5:07 pm, Anthony Crumley wrote: > Sean, > > Would flash.now work? > > http://apidock.com/rails/ActionControl

Re: [Rails] How to check if a parent has children?

2010-04-12 Thread Anthony Crumley
Paul, Sorry, but I gave you the wrong method. It should have been ... unless @client.line_items.empty? Anthony Crumley http://commonthread.com On Mon, Apr 12, 2010 at 9:10 PM, Paul Jonathan Thompson wrote: > Thanks Anthony, > > It's better, but I'm not quite there yet. I am now getting: > >

[Rails] Re: NESTED routes?

2010-04-12 Thread David Zhu
nvm heres a great link-- http://weblog.jamisbuck.org/2007/2/5/nesting-resources Excellent explanation, worked for me at least :D On Apr 12, 8:35 pm, David Zhu wrote: > Hey everyone, > > What if i need to do this in my routes.rb-- > > a has many b, b has many c, and c has many d > > How on earth

Re: [Rails] How to check if a parent has children?

2010-04-12 Thread Paul Jonathan Thompson
Thanks Anthony, It's better, but I'm not quite there yet. I am now getting: wrong number of arguments (0 for 1) Regards, Paul Thompson On 13 April 2010 13:56, Anthony Crumley wrote: > Paul, > > if @client.line_items.exists? > > Anthony Crumley > On Mon, Apr 12, 2010 at 8:30 PM, Paul Jonatha

[Rails] Tracking User Behaviour

2010-04-12 Thread David
Are there any good log analyzers that help you see user behavior, like tracking user clicks, and not just analyze for performance? -- 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...@googl

[Rails] Re: Re: Customized Route Resource Helper URLs (to not use '

2010-04-12 Thread Seth Willits
Aha! That was even better than I hoped for. to_param is exactly what I needed. Thanks -- 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] How to check if a parent has children?

2010-04-12 Thread Anthony Crumley
Paul, if @client.line_items.exists? Anthony Crumley http://commonthread.com On Mon, Apr 12, 2010 at 8:30 PM, Paul Jonathan Thompson wrote: > What is the new way to check if a parent has child items? In rails > 1.2.6 I did this: > > if @client.has_line_items? > > Client being the parent and line

[Rails] Need to turn off caching of associative table: statuses getting scrambled

2010-04-12 Thread koicat
Am in development mode. I have an associative table (scripts_runs) (has_many, through) that carries a status column ('started', 'ready to parse', 'completed' ). The started and ready to parse states are signaled by 'flag' files from distributed executions of the scripts pickedup periodically (20 s

Re: [Rails] Re: Customized Route Resource Helper URLs (to not use 'id')

2010-04-12 Thread Anthony Crumley
Seth, This article may be helpful. http://www.viget.com/extend/pain-free-pretty-urls-in-rails/ Anthony Crumley http://commonthread.com On Mon, Apr 12, 2010 at 6:25 PM, Seth Willits wrote: > > Change what exactly? The resources method does not have options to > customize the behavior of the he

[Rails] How to check if a parent has children?

2010-04-12 Thread Paul Jonathan Thompson
What is the new way to check if a parent has child items? In rails 1.2.6 I did this: if @client.has_line_items? Client being the parent and line_items the children. Now that I have upgraded to rails 2.0.1 (on my way to current :-) ) I am getting this message: undefined method `has_line_items?'

[Rails] NESTED routes?

2010-04-12 Thread David Zhu
Hey everyone, What if i need to do this in my routes.rb-- a has many b, b has many c, and c has many d How on earth do i define the nested routes like that? Thanks -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group,

[Rails] Re: ror noob need help with easy hidden_field question

2010-04-12 Thread Sioux Sioux
code for others: class User < ActiveRecord::Base before_save :create_username private def create_username self.username = self.email.split('@',2).first end end -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "R

[Rails] Re: ror noob need help with easy hidden_field question

2010-04-12 Thread Sioux Sioux
Philip Hallstrom wrote: > Why do you need to put it into the form? Seems like this would be a > good spot for a before_save handler in your user model. Check to see > if the :username field is blank and if so, set it to the first bit of > the email address... > > -philip Thanks! before_save w

[Rails] Change the View Directory

2010-04-12 Thread Brent
How do I change the view directory? My situation is: I am creating a CMS for personal use, that I will also have a public view for people to play with the CMS without harming the DB. I'm thinking of creating a new app that takes from a different DB, but uses the same views (so I don't have to dupl

[Rails] rails routes and regex

2010-04-12 Thread Me
We have an api set up where the version will change is there a way to map the :controller part to take that part into account and not have to map v1 v2... map.connect 'api/:v/:controller/:action', :controller => 'api/:v/:controller', :v => /v\d+/ Can I use :v in both sections or just the first pa

[Rails] Re: Customized Route Resource Helper URLs (to not use 'id')

2010-04-12 Thread Seth Willits
Change what exactly? The resources method does not have options to customize the behavior of the helper methods. -- 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 emai

Re: [Rails] SQL/Paginate help needed for has_many :through relationship

2010-04-12 Thread Anthony Crumley
Max, How about something like... :order=>"(CASE WHEN tags.name = 'piano' THEN 1 ELSE 0 END) desc, tags.name", Anthony Crumley http://commonthread.com On Mon, Apr 12, 2010 at 10:02 AM, Max Williams wrote: > Hey all. I'm doing a paginated find with will_paginate, with a fairly > complex set of

Re: [Rails] Rails NEW and ADVANCED

2010-04-12 Thread Anthony Crumley
http://railscasts.com/ On Mon, Apr 12, 2010 at 6:40 AM, Newb Newb wrote: > Hello All, > i would like to know what are rails new and advanced concepts that i can > learn and try with... > > Pls provide me any link or suggestions > > Thanks for your info... > -- > Posted via http://www.ruby-forum

Re: [Rails] ror noob need help with easy hidden_field question

2010-04-12 Thread Philip Hallstrom
I'm trying to save users the trouble of creating a username, so I am generating it based on their email address. It doesn't need to be unique, it is used in the view only, but that's not my question. My question is how do I store it when the user fills out the form? Obviously, this won't work, b

Re: [Rails] Clearing a plugins instance variables on each request

2010-04-12 Thread Anthony Crumley
Sean, Would flash.now work? http://apidock.com/rails/ActionController/Flash/FlashHash/now Anthony Crumley http://commonthread.com On Sun, Apr 11, 2010 at 11:11 PM, SeanWalberg wrote: > I'm trying to move some of my application's code into a plugin, > specifically the part that deals with web

[Rails] Re: accepts_nested_attributes + polymorphic association

2010-04-12 Thread Dan Marks
i was so wrapped up in the polymorphic + nested attributes, i forgot :dependent => :destroy on the model i was having issues with doh! -- 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 t

Re: [Rails] complete validation failures

2010-04-12 Thread Anthony Crumley
badnaam, The following should have f.select. <%= select_tag :level, options_for_select([["Base", 1], ["Silver", 2], ["Gold", 3]]) %> On Sun, Apr 11, 2010 at 4:41 PM, badnaam wrote: > All the validations fail, even though the values in the params[] are > valid. Here is the error in the logs, t

Re: [Rails] Administration

2010-04-12 Thread Anthony Crumley
ChaosKnight, Generally, separate admin controllers are not my preference and don't seem to be a clean restful representation of the problem. I prefer having one set of controllers for the entities in the system with some actions only allowed to admins. Also, some actions will work differently fo

[Rails] ror noob need help with easy hidden_field question

2010-04-12 Thread Sioux Sioux
I'm trying to save users the trouble of creating a username, so I am generating it based on their email address. It doesn't need to be unique, it is used in the view only, but that's not my question. My question is how do I store it when the user fills out the form? Obviously, this won't work, bc

[Rails] Re: gem install rails (Errno::ENOENT) No such file or directory

2010-04-12 Thread Jesús Dugarte
Jesús Dugarte wrote: > I have two PCs, one with Windows XP and another with Windows Vista. I'm > working as an administrator in both computers. I'm using Ruby 1.8.7 and > Rubygems 1.3.6. When I try to install Rails I get this error: > > C:\>gem install rails > ERROR: While executing gem ... (Errn

[Rails] Re: How to copy a selected value into a text_field

2010-04-12 Thread RichardOnRails
PRiyanka and sameera: Thank you both very much!!! I've been pulling my hair out for about a week with this thing. I didn't realize that the first argument of the select_tag function apparently identifies the target of the selected item in the format "table_name[column_name]". Now that you've giv

Re: [Rails] simple role system through associative table

2010-04-12 Thread Anthony Crumley
Daniel, Adding attributes to the HMT model is an acceptable practice. Originally HABTM was used for many-to-many relationships and it assumed a simple table in the middle with the related ids. The problem was that the relationship table often needed to become a model of its own with additional a

[Rails] Re: minify html views layouts

2010-04-12 Thread Christophe
I guess you're talking about reducing the code produced by your rails app. Are you using the -%> notation such as : <% if condition ... -%> The dash before the closing tag is a shortcut that make sure no new line will be added at this point. This is the only trick I can think about. Christophe

[Rails] Re: gem install rails (Errno::ENOENT) No such file or directory

2010-04-12 Thread Jesús Dugarte
Chris Morris wrote: > Try running Sysinternals Process Monitor and look for file system > activity > around the time the error occurs. Could give more details on why ruby > can't > see that folder. (What's the error msg on XP? That msg looks Vista > specific). > > On Fri, Apr 9, 2010 at 3:48 PM,

Re: [Rails] Re: clicking to add content is adding it outside of the page's table

2010-04-12 Thread Colin Law
On 12 April 2010 18:14, Hassan Schroeder wrote: > On Mon, Apr 12, 2010 at 9:50 AM, ES wrote: >> So what can be a child of div?  I've tried p and that still places the >> new content it outside the table.  I have a div encompassing the >> entire page so that it can be formatted with my leftcontain

Re: [Rails] Re: partial being rendered outside of table format

2010-04-12 Thread Colin Law
On 12 April 2010 16:59, ES wrote: > I just realized that Firebug doesn't correctly display what content is > in what tags.  The source file says this: > > > > > for="echantillon_treatments_attributes_1_treatmenttype">type de > traitement > name="echantillon[treatments_attributes][1][treatmentty

[Rails] Re: gem install rails (Errno::ENOENT) No such file or directory

2010-04-12 Thread Jesús Dugarte
Rahul Mehta wrote: > 1)Go to http://rubyonrails.org/download that is official download > page for ruby on rails. > > 2)First download ruby. For windows it is one click installer > package just download it and double click it and follow installation > wizard. > > 3)Download ruby gems

[Rails] Re: gem install rails (Errno::ENOENT) No such file or directory

2010-04-12 Thread Jesús Dugarte
Anthony Crumley wrote: > Jesús, > > Have you tried installing ruby into a directory path that does not have > any > spaces in it? > > Anthony Crumley > http://commonthread.com Ruby is actually installed in the default directory, C:\Ruby, without spaces o any other special character. And I don'

Re: [Rails] Re: clicking to add content is adding it outside of the page's table

2010-04-12 Thread Hassan Schroeder
On Mon, Apr 12, 2010 at 9:50 AM, ES wrote: > So what can be a child of div?  I've tried p and that still places the > new content it outside the table.  I have a div encompassing the > entire page so that it can be formatted with my leftcontainer side > menu. That's fine but irrelevant -- the on

[Rails] Re: Problem for CSV import

2010-04-12 Thread Ar Chron
Tushar Gandhi wrote: > Hi, > I am doing a finctionality to import csv file. > My CSV file is like this > Header-- Name,Address,Details > Data-- Tushar, sangavi,pune, I am a ror developer > > My controller code is:- > @parsed_file=CSV::Reader.parse(params[:dump][:file]) > @parsed_file.each do |

[Rails] Re: clicking to add content is adding it outside of the page's table

2010-04-12 Thread ES
So what can be a child of div? I've tried p and that still places the new content it outside the table. I have a div encompassing the entire page so that it can be formatted with my leftcontainer side menu. What tag can I use to insert the html content successfully into the table in the page?

Re: [Rails] clicking to add content is adding it outside of the page's table

2010-04-12 Thread Hassan Schroeder
On Mon, Apr 12, 2010 at 9:24 AM, ES wrote: > Each time the "add" button in my nested form is clicked, it adds the > partial to the end of the page, not inside in the table. > >   >      <% echantillon_form.fields_for :treatments do |builder| %> >         <%=  render :partial => "treatment_fields

[Rails] Re: Declaring arrays shared across different controller methods

2010-04-12 Thread Ar Chron
ES wrote: > I would like to have an array saving fields to display for an object > that is used for its form on multiple pages. > > I have declared the array in each of the controller methods that would > use it. Where can I put the array so that I only have to define it > once and then use it re

[Rails] clicking to add content is adding it outside of the page's table

2010-04-12 Thread ES
Clicking the "add" button in my nested form is adding the content outside of the page's main table, how can I get it to add the html into the table that the link is contained in? I followed the Railscast http://railscasts.com/episodes/197-nested-model-form-part-2 My view file: <% echan

[Rails] clicking to add content is adding it outside of the page's table

2010-04-12 Thread ES
Each time the "add" button in my nested form is clicked, it adds the partial to the end of the page, not inside in the table. My view file: <% echantillon_form.fields_for :treatments do |builder| %> <%= render :partial => "treatment_fields", :locals => {:f => builder} %>

[Rails] Re: Re: Accessing method in another controller

2010-04-12 Thread Ar Chron
Andy Jeffries wrote: > > I'd say it depends on whether Y really IS AN X. If not, but they have > similar roles, I'd say you're better of doing this: > > class Z < ApplicationController > def some_method > ... > end > end > > class X < Z > ... > end > > class Y < Z > ... > end > I

[Rails] Re: find all by a different association id

2010-04-12 Thread Brent
OK I think I found the solution: @types = @page.attachment_types <% @types.each do |t| %> <%= render(:partial => 'partial/attachment', :collection => t.attachments.find_all_by_page_id(@page.id)) %> <% end %> didn't know I could still call the find_all_by_page_id after I called it from a

[Rails] Re: partial being rendered outside of table format

2010-04-12 Thread ES
I just realized that Firebug doesn't correctly display what content is in what tags. The source file says this: type de traitement commentaires sur la preparation remove while firebug says that the fields are actually outside of the tags. Why would that be? Also, why is it putti

[Rails] Re: find all by a different association id

2010-04-12 Thread Brent
Hmm.. OK I did this and I can grab attachment_types through a page. BUT I can't grab the specific attachments in the attachment_types in a page.. for instance if I try this: @types = @page.attachment_types <% @types.each do |t| %> <%= render(:partial => 'partial/attachment', :collection => t

[Rails] Re: partial being rendered outside of table format

2010-04-12 Thread Ryan Bates
You need to nest the table content inside ... tags. It's not valid HTML otherwise. Regards, Ryan On Apr 12, 7:53 am, ES wrote: > I'm following this nested forms > railscasthttp://railscasts.com/episodes/197-nested-model-form-part-2 > > but each time that new fields are added to my form the f

[Rails] SQL/Paginate help needed for has_many :through relationship

2010-04-12 Thread Max Williams
Hey all. I'm doing a paginated find with will_paginate, with a fairly complex set of associations and ordering clauses. Here's the associations relevant to this example: Question belongs_to :subject #standard acts_as_taggable setup has_many :taggings, :conditions => ["taggable_type => ?",

[Rails] partial being rendered outside of table format

2010-04-12 Thread ES
I'm following this nested forms railscast http://railscasts.com/episodes/197-nested-model-form-part-2 but each time that new fields are added to my form the fields are added above my table. Therefore, when the remove links are clicked, it can't find the section to delete. What am I doing wrong?

Re: [Rails] Re: Accessing method in another controller

2010-04-12 Thread Andy Jeffries
On 12 April 2010 15:07, RVince wrote: > Seems the best solution is the straight OOP solution: > > class Y < X >... > something = some_method > > end > I'd say it depends on whether Y really IS AN X. If not, but they have similar roles, I'd say you're better of doing this: class Z

[Rails] Re: controller to controller call

2010-04-12 Thread Me
Ya, I am trying to do the create user/login in one step in clearance. On Apr 12, 9:34 am, RVince wrote: > See my post a few posts earlier on accessing a method in another > controller, or you can always put the common method in a module. - > RVince > > On Apr 12, 10:27 am, Me wrote: > > > How wo

[Rails] Re: controller to controller call

2010-04-12 Thread RVince
See my post a few posts earlier on accessing a method in another controller, or you can always put the common method in a module. - RVince On Apr 12, 10:27 am, Me wrote: > How would you call an action from one controller to another? -- You received this message because you are subscribed to the

[Rails] controller to controller call

2010-04-12 Thread Me
How would you call an action from one controller to another? -- 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...@googlegroups.com. To unsubscribe from this group, send email to rubyonrail

[Rails] Re: Need a dropdown having "more.." option

2010-04-12 Thread Me
You could always just render the output the results to the screen and not mess with the drop down. That would be much easier, then you could just have a "more" button at the bottom like twitter does. On Apr 12, 7:16 am, Andy Jeffries wrote: > On 10 April 2010 09:47, Samiron wrote: > > > I have

Re: [Rails] Anyone knows of a opensource dating app ?

2010-04-12 Thread jason white
On 4/12/2010 8:05 AM, rubybox wrote: Anyone knows of a opensource dating app for ruby on rails or anything that can be formed into it? Anyone knows of one? this may get you going in the right direction http://lovdbyless.com/ http://www.opensourcerails.com/projects?q=social&x=5&y=8

[Rails] [JOBS] Innovative Agile ruby on rails developer / technologist - India

2010-04-12 Thread hughhoffy
We are looking for an innovative ruby on rails developer to work remotely from India on projects in Australia full-time 40 hours per week. Please respond to info[at]ennova.com.au We are looking for developers with the following skills: - Strong in test driven development & behavior driven develop

[Rails] Re: Accessing method in another controller

2010-04-12 Thread RVince
Seems the best solution is the straight OOP solution: class Y < X ... something = some_method end -- 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...@googlegroups.com. To u

Re: [Rails] Problem for CSV import

2010-04-12 Thread Andy Jeffries
> > My problem is if you looked at it that address is "sangavi,pune". But > whenever I am printing the row values. I am getting row[1] as "sangavi" > and row[2] as "pune", which is not correct, Can anyoneone tell me how > should I solve this problem? > Get the original data in a better format than

[Rails] Re: $(link).previous("input[type=hidden]") is undefined

2010-04-12 Thread ES
the problem was that I didn't have "_fields" as part of the name of my partial. On Apr 12, 3:24 pm, ES wrote: > I had to restructure my page in html so that the link did follow the > hidden input field.  It works now but when I follow the further > instructions in the railscast to have an "add"

[Rails] Re: $(link).previous("input[type=hidden]") is undefined

2010-04-12 Thread ES
I had to restructure my page in html so that the link did follow the hidden input field. It works now but when I follow the further instructions in the railscast to have an "add" link to add an object, I get this error: undefined method `render_partial' for # this is my view: <% ech

[Rails] Problem for CSV import

2010-04-12 Thread Tushar Gandhi
Hi, I am doing a finctionality to import csv file. My CSV file is like this Header-- Name,Address,Details Data-- Tushar, sangavi,pune, I am a ror developer My controller code is:- @parsed_file=CSV::Reader.parse(params[:dump][:file]) @parsed_file.each do |row| p row[1] p row[2] end

Re: [Rails] Anyone knows of a opensource dating app ?

2010-04-12 Thread Peter Hickman
Given that the world and his dog thinks that a dating site is going to make them overnight millionaires I really doubt that anyone will be giving the source away. Having said that the mechanics would be pretty trivial, the big problem is getting people to join. -- You received this message becau

[Rails] Anyone knows of a opensource dating app ?

2010-04-12 Thread rubybox
Anyone knows of a opensource dating app for ruby on rails or anything that can be formed into it? Anyone knows of one? -- 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...@googlegroups.com.

[Rails] Re: Nested forms: Can you access the object from within fields_for?

2010-04-12 Thread toamitku...@gmail.com
Yes u can with friend.object.name On Apr 11, 10:13 pm, John Grimes wrote: > Hi all, > > Say I had the following form: > > <% form_for @user do |f| %> >   <%= f.error_messages %> >   <% f.fields_for :friends do |friends| %> >     <%= friends.text_field :relationship_to_you %> >   <% end %> >   <%=

Re: [Rails] Need a dropdown having "more.." option

2010-04-12 Thread Andy Jeffries
On 10 April 2010 09:47, Samiron wrote: > I have a collection of products that I am showing in a dropdown. Now > at the first view it will show only first 10 products in the dropdown > with an option "more..." at last. if user clicks the "more..." he can > see all the following products in that dr

[Rails] Re: Problem with basic routing

2010-04-12 Thread Benchips
The app folder is located on the server machine, in /usr/local (this is a Fedora installation). I have a root access to the server, but it has been running for 2 or 3 weeks and I don't know exactly how (a system team handles it). After modifying the httpd.conf, I reloaded the server and it seems

[Rails] Rails NEW and ADVANCED

2010-04-12 Thread Newb Newb
Hello All, i would like to know what are rails new and advanced concepts that i can learn and try with... Pls provide me any link or suggestions Thanks for your info... -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby

Re: [Rails] Problem with basic routing

2010-04-12 Thread Anthony
I guess you not used this commend : rake db:migrate RAILS_ENV="test" 2010/4/12 Benchips > Hi everybody! > > I am new in the RoR world and I'm currently following the step by step > tutorial for creating the basic "hello, Rails" stuff. Everything goes > well till I try to display the page throug

[Rails] Accessing method in another controller

2010-04-12 Thread RVince
If I have : class X < ApplicationController def some_method ... end end and I have class Y < ApplicationController end How, from a method within class Y, can I call class X's some_method ? TIA, RVince -- You received this message because you are subscribed to the Google Groups "Ruby

[Rails] Re: $(link).previous("input[type=hidden]") is undefined

2010-04-12 Thread Frederick Cheung
On Apr 12, 11:22 am, ES wrote: > >          <%= f.hidden_field :_destroy %> > >        <%= link_to_function "remove", "remove_fields(this)" > %> > > > > and in the appliction.js file I have: > > function remove_fields(link) { > >   $(link).previous("input[type=hidden]").value = "1"; >   $(link)

[Rails] Re: daemon() function is unimplemented

2010-04-12 Thread An Car
Frederick Cheung wrote: > On Apr 12, 10:43�am, Andrea Cardillo wrote: >> Hi all, >> I'm a newbie... so be patient pliz >> >> ;-) >> >> I'm starting to use Rails on my machine (OS: Win 7) but when I'm trying >> to connect tohttp://0.0.0.0:3000I get nothing. >> >> So I launch rails in this way: � ru

Re: [Rails] Problem with basic routing

2010-04-12 Thread Anthony
how did you run it ? 2010/4/12 Benchips > Hi everybody! > > I am new in the RoR world and I'm currently following the step by step > tutorial for creating the basic "hello, Rails" stuff. Everything goes > well till I try to display the page through the server. > Apparently, I have to go to "http

[Rails] Problem with basic routing

2010-04-12 Thread Benchips
Hi everybody! I am new in the RoR world and I'm currently following the step by step tutorial for creating the basic "hello, Rails" stuff. Everything goes well till I try to display the page through the server. Apparently, I have to go to "http://webserver:3000/home/index to see the page, but the

[Rails] Re: daemon() function is unimplemented

2010-04-12 Thread Frederick Cheung
On Apr 12, 10:43 am, Andrea Cardillo wrote: > Hi all, > I'm a newbie... so be patient pliz > > ;-) > > I'm starting to use Rails on my machine (OS: Win 7) but when I'm trying > to connect tohttp://0.0.0.0:3000I get nothing. > > So I launch rails in this way:   ruby script/server -d > Drop the -

[Rails] $(link).previous("input[type=hidden]") is undefined

2010-04-12 Thread ES
I am getting this error when trying to use the remove link explained in the Railscast: http://railscasts.com/episodes/197-nested-model-form-part-2 error: $(link).previous("input[type=hidden]") is undefined remove_fields()applic...1065175 (line 6) function onclick(event) { remove_fields(this); ret

[Rails] daemon() function is unimplemented

2010-04-12 Thread Andrea Cardillo
Hi all, I'm a newbie... so be patient pliz ;-) I'm starting to use Rails on my machine (OS: Win 7) but when I'm trying to connect to http://0.0.0.0:3000 I get nothing. So I launch rails in this way: ruby script/server -d this is the answer: " C:\Ruby19\rubyApps\bookmark_manager>ruby script/s

[Rails] Re: Re: Re: Re: I18n retuns empty string?

2010-04-12 Thread Heinz Strunk
Heinz Strunk wrote: > I figured out that there's a problem with the .yml file. When I remove > my yml file everything works just fine but when I add my .yml file with > my customized language strings like: > de-DE: > time: > formats: > default: "%A, %e. %B %Y, %H:%M Uhr" > > It retur

Re: [Rails] Declaring arrays shared across different controller methods

2010-04-12 Thread Colin Law
On 9 April 2010 15:13, Anthony Crumley wrote: > ES, > You really can't do that as you have described because each controller > method represents a different http request and a brand new instance of the > controller is created.  So an array that is saved in a previous request > won't be available i

[Rails] Re: "We're sorry, but something went wrong"

2010-04-12 Thread sameera
Hi Looks like you are using sqlite as thr database. so make sure you installed the sqlite gem sqlite3-ruby (1.2.5) you can check this from the command 'gem list' in the command prompt if not install it using the following command, gem install sqlite3-ruby cheers, sameera On Apr 9, 5:35 am,

[Rails] Re: getting a duplicate record with has_many and update_attributes

2010-04-12 Thread Frederick Cheung
On 12 Apr, 05:25, Bob Smith wrote: > Please help. I've tried all i know with no results... > > I have an app with a master class using has_many to another class. > When I create a new record with the params showing all fields for > master and the has_many class it seems to work OK. But doing an

[Rails] Re: How to copy a selected value into a text_field

2010-04-12 Thread sameera
hi RichardOnRails Try this <%= select_tag 'expense[vendor]', options_for_select(@current_vendors) %> cheers, sameera On Apr 11, 7:18 am, RichardOnRails wrote: > In app\views\expenses\new.html.erb,  I (mistakenly) replaced the > script/generated: > <%= f.label :vendor %> > <%= f.text_field

[Rails] Re: Reloading controller plugins on each request

2010-04-12 Thread Frederick Cheung
On 12 Apr, 04:03, Nick wrote: > On Apr 11, 6:26 pm, Frederick Cheung > wrote: > > > If you want something to be reloadable you should use > > require_dependency to load it. The main thing though is that a > > plugin's init.rb is not re-run between requests, so the include you do > > on Applicat

[Rails] Re: Customized Route Resource Helper URLs (to not use 'id')

2010-04-12 Thread Priya Buvan
You need to change in routes.rb file for getting name instead of id.. -- 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...@googlegroups.com. To un

[Rails] Re: "We're sorry, but something went wrong"

2010-04-12 Thread Priya Buvan
check your database.yml, whether the mentioned database name is correct or not.. -- 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...@googlegroup