[Rails] Adding items in groups in Rails

2010-03-23 Thread Railsquestion Zz
My product table is idtype price location 1 chips $3 aisle3 I have a question with adding the products in groups. There is a quantity field(nonmodel) where the user can enter the quantity While adding a new product if the user enters: type: soda

[Rails] Java script errrrror in rails

2010-03-23 Thread Tony Augustine
when i click a button called add it shouldshow a javascript form showing an uploadfeature.its not displaying anything.instead of tht its only showing the mwssage lik tis in console. please providee a solution ActionView::TemplateError (Called id for nil, which would mistakenly

[Rails] Re: Restful create URL

2010-03-23 Thread DmitryPush
As you now URL its a GET method, but according RESTful rules create it's a POST method. Rails defines seven controller methods for RESTful resources by convention. They are: Action HTTP Method Purpose - indexGET

Re: [Rails] Presentation Ideas

2010-03-23 Thread Andy Jeffries
Cucumber? It could be quite quick to throw together a simple application to manage something (stocks of products) and test it using Cucumber which looks very cool when you first see it. Cheers, Andy -- Andy Jeffries http://andyjeffries.co.uk/ #rubyonrails #mysql #jquery Registered

Re: [Rails] Simple Backup???

2010-03-23 Thread Andy Jeffries
On 20 March 2010 00:33, nshenry03 nshenr...@gmail.com wrote: I am simply trying to backup a ruby on rails app... I have created an archive of the entire database and application folders on server A... I then restore the database and application folders on server B Server B is exactly the

[Rails] Re: How to initially hide a drop-down control and have an image control make it visible

2010-03-23 Thread RichardOnRails
Great response, Michael. I now have a clean validation on the compiled code, but I've still got a problem. I've got clean code that validates. http://www.pastie.org/882256 displays: - new.html.erb - HTML generated for new.html.erb - Validation for generated html, which has one spurious (IMHO)

[Rails] Re: How to initially hide a drop-down control and have an image control make it visible

2010-03-23 Thread RichardOnRails
Hi Hassan, please take a look at my reply to Michael. On Mar 22, 6:11 pm, Hassan Schroeder hassan.schroe...@gmail.com wrote: On Mon, Mar 22, 2010 at 2:51 PM, RichardOnRails richarddummymailbox58...@uscomputergurus.com wrote: Thanks for joining the conversation.  I ran my the HTML page which

[Rails] Re: How to reference a select_tag within a form

2010-03-23 Thread RichardOnRails
Hi Frederick, As I mentioned to Colin, I would start a new thread on this question, which is at

[Rails] Re: Java script errrrror in rails

2010-03-23 Thread Luke Pearce
ActionView::TemplateError (Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id) on line #1 of app/views/lists/import.js.rjs: 1: id = dom_id(@list) Will need to see some code - however the simple answer from your error is that @list is nil.

[Rails] Re: NoMethodError in AdminController#index

2010-03-23 Thread Luke Pearce
Top link in google: http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/39739e012b09f97a/7364aa0c8bf5050f Read the replies about scaffolding basically you'll need to install the scaffolding gem: From a command prompt in your app root: ruby script/plugin install scaffolding

[Rails] h() method in form partial

2010-03-23 Thread Tom Mac
Hi I have a doubt. Dont know it is valid. Just asking. I am trying to reuse the same partial _form for both new and edit. So from new.html.erb I call partial like %= render :partial = 'user_fields', :locals = {:f = f}% and in _user_fields.html.erb an example field as p %= u.label

[Rails] Auto Trim w/ Erubis (Rails 3.0 beta)

2010-03-23 Thread cult hero
Hey, I'm relatively new to Rails. (I was actually a Merb guy before) and I'm getting my feet wet with the beta. It doesn't appear that auto trim is enabled with Erubis by default. What's the proper way to enable this? -- You received this message because you are subscribed to the Google Groups

[Rails] Re: Ruby Manor: Manor Harder - videos now available

2010-03-23 Thread Jacques Crocker
Any chance they are available for download somewhere? Seems like they are currently only playable with the embedded flash player. Sometimes nice to be able to watch these on the bus. On Mar 22, 3:10 am, comopasta Gr li...@ruby-forum.com wrote: Thanks! Already picked a couple that I'll be

[Rails] Re: h() method in form partial

2010-03-23 Thread Luke Pearce
My question is if I call this same partial in edit.html.erb also, how can I apply the h() method like below (since this fields being populated with value from db being an edit form) p %=h u.label :first_name,'First Name' % %=h u.text_field :first_name,:maxlength = 50 %

[Rails] Re: h() method in form partial

2010-03-23 Thread Frederick Cheung
On 23 Mar, 07:46, Tom Mac li...@ruby-forum.com wrote: Hi    I have a doubt. Dont know it is valid. Just asking. I am trying to reuse the same partial _form for both new and edit. So from new.html.erb I call partial like Well it is valid but not useful - The label help would generate

[Rails] Re: How to reference a select_tag within a form

2010-03-23 Thread Frederick Cheung
On 23 Mar, 07:33, RichardOnRails richarddummymailbox58...@uscomputergurus.com wrote: Hi Frederick, As I mentioned to Colin,  I would start a new thread on this question, which is athttp://groups.google.com/group/rubyonrails-talk/tree/browse_frm/threa... Thanks for looking into my

[Rails] ActsAsTaggableOn scoped to Account

2010-03-23 Thread Jonesy
Hi, Can anybody give me some clues how to use ActsAsTaggableOn in an Account scoped way? ie. I want several accounts each to have their own sets of tags to tag their own articles rather than sharing a giant pool of tags. Or perhaps there is a better solution than ActsAsTaggableOn? Thanks! --

[Rails] Re: Presentation Ideas

2010-03-23 Thread Sharagoz --
MVC, DRY, convention over configuration. Those are important concepts in rails. However, in a presentation a lenghtly talk about these things are probably going to be pretty boring. And its not something that student programmers may apprechiate as much as experienced programmers. I would spend

[Rails] Re: Adding items in groups in Rails

2010-03-23 Thread Sharagoz --
I think it makes most sence to have a stock field in the database, instead of having one record per stock item. how to pass such nonmodel html/javascript fields from view to rails and then back to the view You mean non database fields, right? Add this to the model: attr_accessor

Re: [Rails] Re: Re: Re: Issues RUNNING mysql gem

2010-03-23 Thread Colin Law
On 22 March 2010 22:16, Mike Montagne li...@ruby-forum.com wrote: Colin Law wrote: In the case of MySql I believe that the length of a varchar only specifies the maximum length, it does not affect the actual space used in the db as the data is stored as variable length records.  I don't know

[Rails] Re: Adding items in groups in Rails

2010-03-23 Thread Luke Pearce
Seems a little odd what you are doing however to answer your question: You can add a text_field_tag or a select_tag to your form http://api.rubyonrails.org/classes/ActionView/Helpers/FormTagHelper.html#M001731 e.g. %=text_field_tag :quantity% You can then get that via params[:quantity] in

[Rails] Re: Displaying a nested field as a label

2010-03-23 Thread Sharagoz --
If it is going to be read-only, why do you need to display it in a text_area instead of directly on the page? andrew wrote: There is what I'm doing: I want to display a series of text_area fields (read only) of which each has a checkbox. Is this the best way to do it? % form_for

Re: [Rails] Re: Default pricing and custom client pricing

2010-03-23 Thread Colin Law
On 23 March 2010 02:15, Craig White craigwh...@azapple.com wrote: On Tue, 2010-03-23 at 03:02 +0100, Tony Tony wrote: Craig White wrote: I would have a table called pricing and have a column that had the customer_id and thus you might have 2 (or more) prices for an item but only one for a

[Rails] Re: Stored Procedures MYSQL and Rails 2.3.2

2010-03-23 Thread Horace Ho
From the script/console: $ script/console Loading development environment (Rails 2.3.5) /Library/Ruby/Gems/1.8/gems/rails-2.3.5/lib/rails/gem_dependency.rb:119:Warning: Gem::Dependency#version_requirements is deprecated and will be removed on or after August 2010. Use #requirement

Re: [Rails] Re: How to reference a select_tag within a form

2010-03-23 Thread Colin Law
On 22 March 2010 22:32, RichardOnRails richarddummymailbox58...@uscomputergurus.com wrote: Hi Colin, I still don't have subversion not git working. Well the answer to that problem is obvious. Colin But I pretty sure that http://www.pastie.org/881730 presents it all: three aspects of new

[Rails] Re: Saas design considerations

2010-03-23 Thread Tom Mac
hi saljamil and its children. I used named scopes in the model to pass the user_id from controller and get back data specific to that user (his org and children orgs). Send me an email if you need some code examples. I would like to get some code examples. Please send your mailid. My

[Rails] Re: need to parse a User uploaded file, but don't care if it's saved

2010-03-23 Thread Luke Pearce
Don't know if this is any use - but you could just upload it yourself (rather than using paperclip or file_column): http://www.tutorialspoint.com/ruby-on-rails/rails-file-uploading.htm You can choose the directory that you want it saved in, then delete the file as soon as you are done with it.

[Rails] Re: need to parse a User uploaded file, but don't care if it's saved

2010-03-23 Thread Luke Pearce
Sorry just to add that tutorial saves it in a model - but obviously you don't need to do that. -- 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

Re: [Rails] Re: Blank Log Files - New to RoR - Ubuntu Server 9.10

2010-03-23 Thread Michael Pavling
On 22 March 2010 14:11, Justin soniknewme...@gmail.com wrote: I didn't know about www-data, but your suggestion still didn't work. I rebooted the server completely. I still get the blank logs. Also, I still get the correct Welcome Aboard page, but when I click About your application's

Re: [Rails] Re: Blank Log Files - New to RoR - Ubuntu Server 9.10

2010-03-23 Thread Michael Pavling
On 23 March 2010 09:57, Michael Pavling pavl...@gmail.com wrote: On 22 March 2010 14:11, Justin soniknewme...@gmail.com wrote: I didn't know about www-data, but your suggestion still didn't work. I just checked a server I have here (Ubuntu 9.04LTS) and the directory ownership is slightly

[Rails] Re: Newbie needing help on some tricky associations

2010-03-23 Thread Sharagoz
It's hard for us to help you with the associations when you arent describing what you're trying to make. Im gonna try to guess based on what you've given: This is going to be a web shop with products related to cooking. A bunch of products (in this case ingredients) can be put together as a

Re: [Rails] Newbie needing help on some tricky associations

2010-03-23 Thread Colin Law
On 23 March 2010 05:27, Andy andy.bo...@gmail.com wrote: Hello, I'm stuck on some associations that I think may be more complex than I originally anticipated. Not really straightforward stuff for my first Rails app so if you have a chance to point me in the right direction I would really

[Rails] Re: Still Using old Rails even after Upgrade

2010-03-23 Thread jackster the jackle
that worked but now I'm getting require_frameworks': no such file to load -- openssl (RuntimeError) when I try to run Webrick. From what I'm reading, I need to install openssl-dev but since this is a hosting server, I don't have access to a package handler so I contacted web support. Do you

Re: [Rails] Re: Still Using old Rails even after Upgrade

2010-03-23 Thread Michael Pavling
On 23 March 2010 11:30, jackster the jackle li...@ruby-forum.com wrote: that worked but now I'm getting What worked? If you trim the whole previous message, no one knows what you're replying to... require_frameworks': no such file to load -- openssl (RuntimeError) when I try to run Webrick.

[Rails] Re: Extract shapes and text from images

2010-03-23 Thread comopasta Gr
Hi, any hints anybody? Or some references how could that be implemented? Cheers. -- 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

[Rails] Re: Extract shapes and text from images

2010-03-23 Thread Robert Walker
comopasta Gr wrote: Hi, any hints anybody? Or some references how could that be implemented? My guess is that you'll need to ask this on a forum more focused on OCR and graphics processing. This question is not specific to Rails. -- Posted via http://www.ruby-forum.com/. -- You received

[Rails] Re: Question on insert to multiple tables?

2010-03-23 Thread Luke Pearce
You are probably better of posting on the activescaffold group: http://groups.google.com/group/activescaffold Unfortunately their documentation site is down at the moment but I'm pretty sure they describe how to do model associations in activescaffold. http://activescaffold.com/docs To be

[Rails] Re: Newbie needing help on some tricky associations

2010-03-23 Thread Andy
Of course! Thanks very much or your replies, I really appreciate it. The app is an administrative tool, not a front end webstore. Sorry I wasn't more clear upfront, Sharagoz. The user will need to be able to create three types of items in the system via (nested model) forms: MenuItems,

[Rails] Re: ActiveMerchant, Authorize.net and Email Receipts

2010-03-23 Thread Luke Pearce
add_customer_data is called within purchase to process its options hash. My question is in reference to the line that processes the email key: Why on earth does it, after checking to see if the email entry exists, set customer_email explicitly to false? No idea, probably either it was

Re: [Rails] Re: Newbie needing help on some tricky associations

2010-03-23 Thread Colin Law
On 23 March 2010 12:58, Andy andy.bo...@gmail.com wrote: Of course! Thanks very much or your replies, I really appreciate it. The app is an administrative tool, not a front end webstore. Sorry I wasn't more clear upfront, Sharagoz. The user will need to be able to create three types of items

[Rails] regular expression

2010-03-23 Thread Marcio Machado
Hi, I´m trying to write a regular expression to get the substring block in: module$block.item I´ve reached the obvious /\$.*\./ witch returns $block. substring. How do I get directly the block substring? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are

Re: [Rails] regular expression

2010-03-23 Thread Andy Jeffries
$ irb module$block.item[/\$(.*?)\./, 1] = block Cheers, Andy -- Andy Jeffries http://andyjeffries.co.uk/ #rubyonrails #mysql #jquery Registered address: 64 Sish Lane, Stevenage, Herts, SG1 3LS Company number: 5452840 On 23 March 2010 14:03, Marcio Machado li...@ruby-forum.com wrote:

[Rails] Re: Displaying a nested field as a label

2010-03-23 Thread andrew
That's my question! How do you do that. % a.text % gives me this error: NoMethodError in Sections#edit_acknowledgments Showing app/views/sections/edit_acknowledgments.html.erb where line #11 raised: Thanks! -a On Mar 23, 3:47 am, Sharagoz -- li...@ruby-forum.com wrote: If it is going to be

[Rails] Re: How do I set defaults for view parameters?

2010-03-23 Thread Civ2boss
Thanks that works! I was trying params[:find_dates] == nil, params[:find_dates].blank?, params[:find_dates] == , but obviously none of them worked. Here's an sort of off-topic question how would I go about getting format.csv { render :csv = @logs } to work? Rails gives a method not found error.

Re: [Rails] Re: Displaying a nested field as a label

2010-03-23 Thread Michael Pavling
On 23 March 2010 14:55, andrew andrew.ggro...@gmail.com wrote: That's my question!  How do you do that. % a.text % gives me this error: %=h a.text % BTW, a is not a very helpful name for a block variable (or any variable for that matter). Assuming you're not paying for your code by the

Re: [Rails] Re: How do I set defaults for view parameters?

2010-03-23 Thread Colin Law
On 23 March 2010 15:04, Civ2boss civ2b...@gmail.com wrote: Thanks that works! I was trying params[:find_dates] == nil, params[:find_dates] == nil is the same as params[:find_dates].nil? Colin -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk

Re: [Rails] Re: Default pricing and custom client pricing

2010-03-23 Thread Craig White
On Tue, 2010-03-23 at 08:53 +, Colin Law wrote: On 23 March 2010 02:15, Craig White craigwh...@azapple.com wrote: On Tue, 2010-03-23 at 03:02 +0100, Tony Tony wrote: Craig White wrote: I would have a table called pricing and have a column that had the customer_id and thus you

Re: [Rails] Re: Displaying a nested field as a label

2010-03-23 Thread Colin Law
On 23 March 2010 14:55, andrew andrew.ggro...@gmail.com wrote: That's my question!  How do you do that. % a.text % gives me this error: You want just %= text % or probably %= h text % dependant on where text is coming from Colin NoMethodError in Sections#edit_acknowledgments Showing

Re: [Rails] Re: How do I set defaults for view parameters?

2010-03-23 Thread Robin Ting
Well that's strange then, because it still gave me a unexpected nil found error when I use that. Actually now that I think about it, I might have been using it on params[:find_dates]['start_date(1i)'] instead of just the params[:find_dates]. On Tue, Mar 23, 2010 at 11:12 AM, Colin Law

Re: [Rails] Re: Default pricing and custom client pricing

2010-03-23 Thread Colin Law
On 23 March 2010 15:08, Craig White craigwh...@azapple.com wrote: On Tue, 2010-03-23 at 08:53 +, Colin Law wrote: On 23 March 2010 02:15, Craig White craigwh...@azapple.com wrote: On Tue, 2010-03-23 at 03:02 +0100, Tony Tony wrote: Craig White wrote: I would have a table called

Re: [Rails] Re: How do I set defaults for view parameters?

2010-03-23 Thread Colin Law
On 23 March 2010 15:20, Robin Ting civ2b...@gmail.com wrote: Well that's strange then, because it still gave me a unexpected nil found error when I use that. Actually now that I think about it, I might have been using it on params[:find_dates]['start_date(1i)'] instead of just the

[Rails] Frozen hash problem

2010-03-23 Thread Dudebot
I'd like to delete some records before saving them. I ran this experiment: before_save :prune_lab_datas def prune_lab_datas lab_datas.each do |lab_data| lab_data.destroy end raise lab_datas.to_yaml end But nothing seems to be deleted in the hash: --- - id001

[Rails] Re: need to parse a User uploaded file, but don't care if it's saved

2010-03-23 Thread Jeff Lewis
One way would be to just process the uploaded-file data from the request as needed and not worry about saving or doing anything else with the tmp-saved uploaded-file itself, something like: ### in ./app/models/uploadable_file.rb class UploadableFile ### for use in testing: def

[Rails] Missing number of assertions in test output

2010-03-23 Thread Thiel Chang
Hi, I did a number of test runs from the book Agile Web Development with Rails, third edition, (chapter 14, Task T: Testing). I use Netbeans 6.8 as IDE. All the test output runs are missing the number of assertions. For example: |Finished in 0,733 seconds. 5 tests, 0

[Rails] change column to allow null

2010-03-23 Thread ES
how do I change the column in a table to allow null? I have change_column :docs, :orga,:null in my migration file but I get an error: Mysql::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near

Re: [Rails] Re: How do I set defaults for view parameters?

2010-03-23 Thread Robin Ting
Yeah thanks for the help! By the way do you know how I can get the format.csv { render :csv = @logs } part to work? I have tested it on an index page and that works, but when I try it on this admin page it says it doesn't understand the URL. I have set a direct path to the admin page instead of

[Rails] Re: change column to allow null

2010-03-23 Thread ES
Actually, I had :null= true On Mar 23, 5:01 pm, ES emsto...@gmail.com wrote: how do I change the column in a table to allow null? I have     change_column :docs, :orga,    :null in my migration file but I get an error: Mysql::Error: You have an error in your SQL syntax; check the manual

Re: [Rails] Re: How do I set defaults for view parameters?

2010-03-23 Thread Colin Law
On 23 March 2010 16:03, Robin Ting civ2b...@gmail.com wrote: Yeah thanks for the help! By the way do you know how I can get the format.csv { render :csv = @logs } part to work? I have tested it on an index page and that works, but when I try it on this admin page it says it doesn't

Re: [Rails] Re: change column to allow null

2010-03-23 Thread Colin Law
On 23 March 2010 16:11, ES emsto...@gmail.com wrote: Actually, I had :null= true On Mar 23, 5:01 pm, ES emsto...@gmail.com wrote: how do I change the column in a table to allow null? I have     change_column :docs, :orga,    :null If you check the docs for change_column you will see that

[Rails] Re: change column to allow null

2010-03-23 Thread ES
cool thanks On Mar 23, 5:21 pm, Colin Law clan...@googlemail.com wrote: On 23 March 2010 16:11, ES emsto...@gmail.com wrote: Actually, I had :null= true On Mar 23, 5:01 pm, ES emsto...@gmail.com wrote: how do I change the column in a table to allow null? I have     change_column

Re: [Rails] Re: How do I set defaults for view parameters?

2010-03-23 Thread Robin Ting
I don't, but I figure there must be a way to just have it in the controllers. Oh well thanks, I'll start another thread. On Tue, Mar 23, 2010 at 12:17 PM, Colin Law clan...@googlemail.com wrote: On 23 March 2010 16:03, Robin Ting civ2b...@gmail.com wrote: Yeah thanks for the help! By the way

[Rails] Re: Displaying a nested field as a label

2010-03-23 Thread andrew
Ok, I'll clean up the variable names. Thanks! :) However %=h comment.txt % undefined method `text' %= text % and %=h text % give undefined local variable or method `text' Neither of those ideas work. :( On Mar 23, 10:14 am, Colin Law clan...@googlemail.com wrote: On 23 March 2010

Re: [Rails] Re: How do I set defaults for view parameters?

2010-03-23 Thread Colin Law
On 23 March 2010 16:31, Robin Ting civ2b...@gmail.com wrote: I don't, but I figure there must be a way to just have it in the controllers. Oh well thanks, I'll start another thread. You don't what? It is best to insert your reply at the appropriate point in the comment so that it is easier to

Re: [Rails] Re: Displaying a nested field as a label

2010-03-23 Thread Michael Pavling
On 23 March 2010 16:35, andrew andrew.ggro...@gmail.com wrote: Ok, I'll clean up the variable names.  Thanks!  :) However %=h comment.txt %  undefined method `text' %= text % and %=h text % give undefined local variable or method `text' Neither of those ideas work.  :( Well what *is*

[Rails] netbeans on ubuntu

2010-03-23 Thread Viorel
I just installed Netbeans 6.7 on Ubuntu 9.4 and all seems to be OK, except I get the following error when I try rake tasks: Rails requires RubyGems = 1.3.2 (you have 1.3.1). Please `gem update --system` and try again. Thank you for any help Viorel -- You received this message because you are

Re: [Rails] netbeans on ubuntu

2010-03-23 Thread Michael Pavling
On 23 March 2010 16:47, Viorel viorelvl...@gmail.com wrote: I just installed Netbeans 6.7 on Ubuntu 9.4 and all seems to be OK, except I get the following error when I try rake tasks: If you're installing Netbeans, what's wrong with using the latest version (6.8) Rails requires RubyGems =

Re: [Rails] netbeans on ubuntu

2010-03-23 Thread Colin Law
On 23 March 2010 16:47, Viorel viorelvl...@gmail.com wrote: I just installed Netbeans 6.7 on Ubuntu 9.4 and all seems to be OK, except I get the following error when I try rake tasks: Rails requires RubyGems = 1.3.2 (you have 1.3.1). Please `gem update --system` and try again. That should

[Rails] Re: Displaying a nested field as a label

2010-03-23 Thread andrew
This is a nested model form using to models: section and comment, where section has many comments. text is a field for comments approval_boolean is a field for comments I just want the field value for text to show up as a non-form- element and approval_boolean to show as a check box form

[Rails] Re: How to reference a select_tag within a form

2010-03-23 Thread RichardOnRails
Thanks very much for taking another look at my problem. If you want to use RJS then you need to use the block form of button_to_function Here's the best my brain could come up with %# = button_to_function(ShowList, %page[vendor_droplist].toggle ) % %= button_to_function(ShowList) {

[Rails] submit form in popup and send value back to the main page

2010-03-23 Thread ES
I made a popup within object1's form to show another form to create a new document object to associate with object1. When I click the submit button I want 1) the document object to be created 2) the popup to close 3) the value in the document title field to get added to the document name field in

Re: [Rails] Re: Displaying a nested field as a label

2010-03-23 Thread Michael Pavling
On 23 March 2010 17:01, andrew andrew.ggro...@gmail.com wrote: A!  a.class = formbuilder.  I thought it was a Comments class. Now I know what to look up  I guess my question after all is there any way to extract a data value from a field within a formbuilder? (if I got my terminology

[Rails] Rails 3 + Different ORM

2010-03-23 Thread cult hero
I'm migrating an old project (not Rails) over to Rails 3. I've been using Sequel as my ORM and I'm quite happy with it. However, when I add Sequel models to my app/model directory, they don't seem to load on their own. Am I going to need to load them manually or do I need to set some kind of

[Rails] Re: Displaying a nested field as a label

2010-03-23 Thread andrew
That's exactly what I was looking for! THANK YOU! And thanks for the insight. -a On Mar 23, 12:10 pm, Michael Pavling pavl...@gmail.com wrote: On 23 March 2010 17:01, andrew andrew.ggro...@gmail.com wrote: A!  a.class = formbuilder.  I thought it was a Comments class. Now I know what

[Rails] Re: Rails 3 + Different ORM

2010-03-23 Thread cult hero
Well, ignore that. Rails does autoloading quite a bit differently that I expected and it appears my stuff is getting loaded. *grimace* On Mar 23, 10:13 am, cult hero binarypala...@gmail.com wrote: I'm migrating an old project (not Rails) over to Rails 3. I've been using Sequel as my ORM and

[Rails] :has_many and :controller specified in routes.rb

2010-03-23 Thread gsw
Have an app using older version of Rails (2.3.2) that I need some routing assistance with if anyone has a minute. The app was originally designed to be purely html view, and an xml and json api was hacked on. To keep it clean, we are now moving the first version of the api (v1) under its own

[Rails] Fixtures and Associations

2010-03-23 Thread David Ishmael
I have a concrete table with an associated join table and I'm trying to load up some test data but cannot seem to get the fixtures file correct. The parent/child relationship works great but the fixtures fail to load. Any help would be greatly appreciated. Here is what I have... #

[Rails] Re: submit form in popup and send value back to the main page

2010-03-23 Thread ES
I added some javascript to the create.html.erb template that opens in the popup after the document form submits. The javascript is supposed to close the popup and send the title of the document back to the main page but it's not working. Anyone know why? this is what is in the create.html.erb

[Rails] redirection in format.json ...

2010-03-23 Thread Erwin
I have presently a render :json which modify the current page if @request.save format.html { redirect_to(@request) } format.json { render :json = { :result = 'success', :request = request_path(@request) } } but I would like rather to redirect to an index page I wrote

Re: [Rails] Re: How do I set defaults for view parameters?

2010-03-23 Thread Robin Ting
On Tue, Mar 23, 2010 at 12:43 PM, Colin Law clan...@googlemail.com wrote: On 23 March 2010 16:31, Robin Ting civ2b...@gmail.com wrote: I don't, but I figure there must be a way to just have it in the controllers. Oh well thanks, I'll start another thread. You don't what?  It is best to insert

[Rails] Re: Blank Log Files - New to RoR - Ubuntu Server 9.10

2010-03-23 Thread Justin
Michael, Thanks SO much for helping me. I still haven't gotten the logs to populate, even with root:www-data No luck with your chown -R root:www-data testapp1 If restarted apache: /etc/init.d/apache2 restart * Restarting web server apache2 ... waiting...done. My symbolic link: $ cd

Re: [Rails] Re: Blank Log Files - New to RoR - Ubuntu Server 9.10

2010-03-23 Thread Michael Pavling
On 23 March 2010 19:38, Justin soniknewme...@gmail.com wrote: Michael, Thanks SO much for helping me. I still haven't gotten the logs to populate, even with root:www-data Justin, I don't know what you're so impressed with me for... we've not sorted your problem. And I'm afraid I pretty much

[Rails] Sorting forum topics by the most recent replies

2010-03-23 Thread DanC
I have built a simple forum but am having difficult getting the topics to display in the order of their latest reply. The associations are as follows: class Forum ActiveRecord::Base has_many :topics, :order = sticky DESC, created_at DESC has_many :replies, :through = :topics class Topic

[Rails] Re: NoMethodError in AdminController#index

2010-03-23 Thread dwhitekiss
I still get the same errors when I did option 1 /home/darwin/Sites/music_library/vendor/plugins/scaffolding/lib/ scaffolding.rb:107:in `list' /home/darwin/Sites/music_library/vendor/plugins/scaffolding/lib/ scaffolding.rb:95:in `index'

Re: [Rails] Fixtures and Associations

2010-03-23 Thread Colin Law
On 23 March 2010 18:05, David Ishmael li...@ruby-forum.com wrote: I have a concrete table with an associated join table and I'm trying to load up some test data but cannot seem to get the fixtures file correct. The parent/child relationship works great but the fixtures fail to load. Any help

Re: [Rails] Re: Blank Log Files - New to RoR - Ubuntu Server 9.10

2010-03-23 Thread Craig White
On Tue, 2010-03-23 at 12:38 -0700, Justin wrote: Michael, Thanks SO much for helping me. I still haven't gotten the logs to populate, even with root:www-data No luck with your chown -R root:www-data testapp1 If restarted apache: /etc/init.d/apache2 restart * Restarting web server

Re: [Rails] Re: NoMethodError in AdminController#index

2010-03-23 Thread Colin Law
On 23 March 2010 20:14, dwhitekiss dwhitek...@gmail.com wrote: I still get the same errors when I did option 1 The error you had before was, from your first post, NoMethodError in AdminController#index undefined method `scaffold' for AdminController:Class Are you saying you still get that

Re: [Rails] :has_many and :controller specified in routes.rb

2010-03-23 Thread Lasse Bunk
Maybe you could use: map.resources :buckets, :controller = 'v1/buckets' do |buckets| buckets.resources :apples, :controller = 'v1/apples' end I know this is a bit more code than just using :has_many, but I don't think :has_many lets you specify a different controller. /Lasse 2010/3/23 gsw

Re: [Rails] Sorting forum topics by the most recent replies

2010-03-23 Thread Jack Christensen
On 3/23/2010 2:56 PM, DanC wrote: I have built a simple forum but am having difficult getting the topics to display in the order of their latest reply. The associations are as follows: class Forum ActiveRecord::Base has_many :topics, :order = sticky DESC, created_at DESC has_many

[Rails] Upcoming app Research and Prep

2010-03-23 Thread brianp
Hey everyone. I'm a one person team and in the next month need to produce and deploy an application. I've been playing with rails for a little over a year now and recently deployed my first app as a private contract. I'm now planning development on a start up company. The app should be

[Rails] Re: Simple Backup???

2010-03-23 Thread nshenry03
Thanks Andy and ayupmeduck... Yes, this was the issue (Sorry, I'm mostly a LAMP guy, this was probably pretty obvious to Rails developers)... In our clean scripts we were running a command to create a new Rails project before we restored. I got rid of this and started with a clean folder and

Re: [Rails] redirection in format.json ...

2010-03-23 Thread Lasse Bunk
Here is an example: format.json { render :json = { :redirect = requests_url } } and then on your client redirect like this: if (json.redirect) { window.location = json.redirect; } Also try http://www.google.com/search?q=json+redirect Does this solve your problem? /Lasse 2010/3/23

[Rails] has_many_polymorphs with searchlogic

2010-03-23 Thread tispratik
Has anyone been able to use searchlogic with has_many_polymorphs? Are they compatible? -- 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,

[Rails] How to move ruby from /usr/bin/ to /usr/local/bin/ on OSX Snow leopard 10.6

2010-03-23 Thread Peter
Hi i'm a beginner to ruby on rails and I am trying to start a tutorial but having trouble making sure ruby is in the right place. When i use the terminal and ask which ruby it comes back with /usr/bin/ whilst I think i needs it to be in usr/local/bin but i don't know how to get it there. There is

[Rails] Re: redirection in format.json ...

2010-03-23 Thread Kad Kerforn
Lasse Bunk wrote: Here is an example: format.json { render :json = { :redirect = requests_url } } and then on your client redirect like this: if (json.redirect) { window.location = json.redirect; } Also try http://www.google.com/search?q=json+redirect Does this solve

Re: [Rails] How to move ruby from /usr/bin/ to /usr/local/bin/ on OSX Snow leopard 10.6

2010-03-23 Thread Conrad Taylor
On Tue, Mar 23, 2010 at 1:25 PM, Peter peterorp...@me.com wrote: Hi i'm a beginner to ruby on rails and I am trying to start a tutorial but having trouble making sure ruby is in the right place. When i use the terminal and ask which ruby it comes back with /usr/bin/ whilst I think i needs it

[Rails] Re: redirection in format.json ...

2010-03-23 Thread Kad Kerforn
in my controller the create action is : respond_to do |format| if @request.save flash[:notice] = 'Request was successfully created.' format.html { redirect_to requests_url } format.xml { render :xml = @request, :status = :created, :location = @request }

[Rails] Re: Rails 3: Update responding with empty json

2010-03-23 Thread Fabio Kreusch
No ideas? On Mar 22, 7:42 pm, Fabio Kreusch fabi...@gmail.com wrote: This is it (HAML): #category-form   - form_for @category, :remote = true do |f|     %fieldset       %legend= t('activerecord.models.category')       %p         = f.label :name         %br         = f.text_field :name  

[Rails] Re: need to parse a User uploaded file, but don't care if it's saved

2010-03-23 Thread GoodGets
@Luke: Thanks! Yeah, I saw that tutorial, too. But, also like you said, it still saves it to a model, so I'd rather just let paperclip handle all that. Thank you anyway though. @Jeff: Thank you! For full disclosure, I'm still a little bit of a noob to Rails (and ruby) but I think I get more

[Rails] form_for with nested shallow route

2010-03-23 Thread Alex
Let's say I have: map.resources :teams do |team| team.resources :squads, :shallow = true end When I want to generate a form_for a squad, I need both the team and squad for new/create, but only the squad for edit. This means I need: edit: form_for(squad) new: form_for([team, squad])

[Rails] Rails 3 beta plugins

2010-03-23 Thread Ken Foust
Has anyone actually installed a plugin? I have used rails plugin install git://github.com/binarylogic/authlogic.git I reacts too fast - doesn't complain but you can't find the plugin anywhere. I have seen people giving advice on rails 3 to use script/plugin obviously they are responding having

  1   2   >