[Rails] Validation of XML with XmlSimple

2011-05-20 Thread Pale Horse
My application needs to check whether a file contains valid XML. I'm using XmlSimple to do the parsing work but wondered how best to validate the XML in the file I'm parsing. I'd appreciate your input. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subsc

[Rails] Re: Migration error

2011-04-28 Thread Pale Horse
> amritpal p. wrote in post #995533: > Run it to generate a new migration > Then ran "rake db:migrate", it created a new columns in table products with > name > "price", but it didn't change the view (didn't create a field with name > "price") > > Why? The clue's in the name - running rake db:mi

[Rails] Re: Create and save nested data

2011-04-28 Thread Pale Horse
> Sebastian wrote in post #995494: > > Thank you! > > I am still having the problem that the URI gets too large if I want to > send to much data to the database. How can I avoid this? What do you mean by 'the URI gets too large'? If you are running Rails 3, I suggest you read more on nested form a

[Rails] Re: Create and save nested data

2011-04-28 Thread Pale Horse
> Sebastian wrote in post #995486: > > I am not quite sure what you meant with 'calling a Model method > directly', probably this one, or? Watchedfamily is your Model in the example below, 'create!' is the method called on it and '(params[:watchedfamily])' is what you are passing to that method.

[Rails] Re: Routing Error

2011-04-28 Thread Pale Horse
> amritpal p. wrote in post #995439: > >> Instead of Goodbye, use <%= link_to >> "Goodbye", :action => "goodbye" %> > > It didn't help, error says: > No route matches {:controller=>"say", :action=>"goodbye"} Of course it didn't, but you are working in a Rails environment so you ought to be using

[Rails] Re: NoMethodError in Book

2011-04-27 Thread Pale Horse
> amritpal p. wrote in post #995333: > > Awaiting your helpful reply!! You've already got an answer - your '@book' method is undefined in the 'new' action of your controller. You need to define '@book' in 'new' before you can access it. When an object such as a variable is undefined, it will re

[Rails] Re: Routing Error

2011-04-27 Thread Pale Horse
> amritpal p. wrote in post #995323: > > class SayController < ApplicationController > def hello > @timee = Time.now > end > def goodbye > > end > end > > /app/views/say/hello.html.erb looks like: > > It is now <%= @timee %> > Goodbye Instead of Goodbye, use <%= link_to "Goodbye", :action =

[Rails] Re: Routing Error

2011-04-26 Thread Pale Horse
> amritpal p. wrote in post #995070: > Generated a controller "rails generate controller say" and then added > a method to id named hello as. > def hello > end > Made a file /app/view/say/hello.html.erb > as "sudo gedit hello.html.erb" and add follwoing to it > > >

[Rails] Re: Routing Error

2011-04-26 Thread Pale Horse
> amritpal p. wrote in post #995117: > >> Please paste your routes.rb file here or use http://pastie.org/ if it's >> too long. > > Age::Application.routes.draw do > root :to => "say#hello" > # See how all your routes lay out with "rake routes" > end > > Amrit pal What is the output of rake route

[Rails] Re: Routing Error

2011-04-26 Thread Pale Horse
> amritpal p. wrote in post #995108: > >> On Apr 26, 9:26am, Pale Horse wrote: >> the root route to take effect." > it helped but without deleting that file and setting routing > path to say controller "localhost:3000/say/hello" wasn't work? i think >

[Rails] Re: Routing Error

2011-04-26 Thread Pale Horse
> amritpal p. wrote in post #995099: > > ok .Done > "root :to => "say#hello"". Still unsussess. > No route matches "/say/hello" > > Thank you. Quoted from the Rails guide: "You should put the root route at the end of the file. You also need to delete the public/index.html.erb file for the root rou

[Rails] Re: XML parsing and scheduling

2011-04-26 Thread Pale Horse
Pale Horse wrote in post #994278: > Colin Law wrote in post #994277: >>> >>> >>> I want to be able to upload an XML file to a directory and schedule my >>> application to parse this XML file to a database every ~15 minutes. >> >> What is the point

[Rails] Re: XML parsing and scheduling

2011-04-21 Thread Pale Horse
Colin Law wrote in post #994277: >> >> >> I want to be able to upload an XML file to a directory and schedule my >> application to parse this XML file to a database every ~15 minutes. > > What is the point of scheduling the parse every 15 minutes, would it > not be better to do it just when the fil

[Rails] XML parsing and scheduling

2011-04-21 Thread Pale Horse
It'd be interesting and useful for me to have your input on this: Currently I have a basic rails app that does nothing particularly special. I want to be able to upload an XML file to a directory and schedule my application to parse this XML file to a database every ~15 minutes. My questions are

[Rails] Scheduled XML parsing

2011-04-21 Thread Pale Horse
It'd be interesting and useful for me to have your input on this: Currently I have a basic rails app that does nothing particularly special. I want to be able to upload an XML file to a directory and schedule my application to parse this XML file to a database every ~15 minutes. My questions are

[Rails] Re: Re: Glossary module

2011-03-01 Thread Pale Horse
Jatin Kumar wrote in post #984692: > On Tue, Mar 1, 2011 at 11:11 AM, Pale Horse > wrote: > > itself but a glossary listing will also be available. > > Honestly, I'm not really sure what the best method of displaying the > definition on the page would be; I don&#

[Rails] Re: Glossary module

2011-03-01 Thread Pale Horse
Jim ruther Nill wrote in post #984685: > On Tue, Mar 1, 2011 at 6:56 PM, Jatin kumar > wrote: > > I'm assuming that he wants to link them because I think there's no use > just > highlighting them. > Ideally, I'd display the definition of the matched term in the Page itself but a glossary listing

[Rails] Glossary module

2011-03-01 Thread Pale Horse
The application I'm currently working on has a Glossary model. The Glossary table has columns for the term and its definition. The application also has Pages which have content. The content needs to highlight any words that match a term in the Glossary table. There'll be a few ways to do this but

[Rails] Re: Redirect issue after update

2010-10-28 Thread Pale Horse
Ganesh Kathare wrote in post #957752: > > Hi, > Why you want to post your form on same (i.e edit) method? > As in rails already has CRUD good feature. So y need to custom your form > submit flow? I asked myself the very same question; it was not me that built the site. I can assure you that if it

[Rails] Re: Redirect issue after update

2010-10-28 Thread Pale Horse
Srikanth Jeeva wrote in post #957747: > > Fine. Can you check the log, copy & paste the params that you get for > the action. Also paste the log till redirect occurs. Processing ProductAdminController#edit (for ---.---.-.-- at 2010-10-28 11:41:01) [POST] Parameters: {"commit"=>"Update", "authe

[Rails] Re: Redirect issue after update

2010-10-28 Thread Pale Horse
Srikanth Jeeva wrote in post #957743: > > Now what is the exact problem here. My apologies, I seem to have omitted the point of my post o.O The problem is that the changes are not being saved and it (seemingly) redirects to the site index. -- Posted via http://www.ruby-forum.com/. -- You rec

[Rails] Redirect issue after update

2010-10-28 Thread Pale Horse
Aside from the fact that the 'edit' method in the following product_admin_controller is using request.post? instead of creating a separate 'update' method, are there any issues with the code that is immediately apparent and I am overlooking? def edit @product = Product.find(params[:id])

[Rails] Re: Empty array check

2010-10-28 Thread Pale Horse
Frederick Cheung wrote in post #957520: > > On Oct 27, 11:43am, Pale Horse wrote: > >> Which of the two methods below are the most stable? Does it matter? >> >> !...@articles.empty? >> @articles.length > 0 >> >> I personally prefer using the '

[Rails] Re: Empty array check

2010-10-27 Thread Pale Horse
Michael Pavling wrote in post #957448: > On 27 October 2010 11:43, Pale Horse wrote: > >> Which of the two methods below are the most stable? Does it matter? >> >> !...@articles.empty? >> @articles.length > 0 >> >> I personally prefer using the

[Rails] Empty array check

2010-10-27 Thread Pale Horse
Which of the two methods below are the most stable? Does it matter? !...@articles.empty? @articles.length > 0 I personally prefer using the 'empty?' method. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails:

[Rails] Re: Noughts and Crosses layout with a variable number of entries

2010-10-15 Thread Pale Horse
Apologies for omitting the code you provided - I needed to reduce the number of quoted lines. Thanks very much, I'll give that a try. I should've considered the in_groups_of method before. I've actually hacked something together that seems to have worked. I'll report back with my results. -- Po

[Rails] Noughts and Crosses layout with a variable number of entries

2010-10-15 Thread Pale Horse
I have a product listing of 9 per-page. The products on the far right and bottom row should NOT have a border on the aforementioned sides. So, similar to a noughts and crosses layout. However, pages do not always have 9 products to display. You may have a better understanding if you see the code I

[Rails] Re: Re: Instances in an array

2010-09-22 Thread Pale Horse
Colin Law wrote: > On 22 September 2010 14:49, Pale Horse wrote: >>> Put the values into an array or the DB, run calculations, display the >>> results. �Which part are you having trouble with? >> >> I've got the values into an array. How, then, do I count t

[Rails] Re: Instances in an array

2010-09-22 Thread Pale Horse
Marnen Laibow-Koser wrote: > Pale Horse wrote: >> I've got a form that has several checkboxes on it with labels and values >> of A - E. I want to display the most commonly selected values. >> >> I also need to consider the possibility that a user may selec

[Rails] Instances in an array

2010-09-22 Thread Pale Horse
I've got a form that has several checkboxes on it with labels and values of A - E. I want to display the most commonly selected values. I also need to consider the possibility that a user may select equal numbers of each value. What would be the best COA for displaying the results of this form? -

[Rails] Re: Re: Multipart email - HTML & document files

2010-08-31 Thread Pale Horse
Peter De Berdt wrote: > > On 31 Aug 2010, at 13:10, Pale Horse wrote: > >>> specify each of the parts (plain, html, attachments etc.) >>> >>> Fred >> >> Thank you for your replies, both of you. It is true that I need to >> split >>

[Rails] Re: Multipart email - HTML & document files

2010-08-31 Thread Pale Horse
Frederick Cheung wrote: > > On Aug 31, 11:34�am, Pale Horse wrote: >> Pale Horse wrote: >> >> > What I want, and can't seem to achieve, is to send an html email with an >> > attachment. As it stands, I can do one or the other and aren't sure how

[Rails] Re: Multipart email - HTML & document files

2010-08-31 Thread Pale Horse
Pale Horse wrote: > > What I want, and can't seem to achieve, is to send an html email with an > attachment. As it stands, I can do one or the other and aren't sure how > to get both to work. > > Mailer: > > http://pastie.org/1128664 > > Correspond

[Rails] Manageable search forms

2010-08-31 Thread Pale Horse
I've got a job search form that will search a 'jobs' table. What would be the best way to give my client the ability to edit the fields in the search form? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk

[Rails] Multipart email - HTML & document files

2010-08-27 Thread Pale Horse
What I want, and can't seem to achieve, is to send an html email with an attachment. As it stands, I can do one or the other and aren't sure how to get both to work. Mailer: http://pastie.org/1119939 Corresponding view: http://pastie.org/1119941 Can anyone give me some assistance with this or

[Rails] Re: Re: link_to_function

2010-08-23 Thread Pale Horse
Bill Walton wrote: > Hi, > > On Mon, Aug 23, 2010 at 10:02 AM, Pale Horse > wrote: >>> >>> If you know at the time of rendering the initial display what >>> information needs to be displayed when the link is clicked, then you >>> should probably

[Rails] Re: link_to_function

2010-08-23 Thread Pale Horse
Bill Walton wrote: > Hi, > > On Mon, Aug 23, 2010 at 8:38 AM, Pale Horse > wrote: >> There is an image to correspond with this. The image is not a problem; I >> have gotten this image to change on click with 'link_to_function'. >> >> The informat

[Rails] link_to_function

2010-08-23 Thread Pale Horse
I require some information, displayed at the top of a page, to change onclick. The information is in the following form: NameJob role Description... <%= link_to "read more", :controller => "controller", :action => "show", :id => id %> telephone number There is an image to correspond with this. T

[Rails] Re: Redirect loop

2010-08-11 Thread Pale Horse
Dave Aronson wrote: > On Wed, Aug 11, 2010 at 06:03, Pale Horse wrote: > >> I have one record in a database that is encountering a redirect loop. > > So what's different about that record? I'd bet it includes or > references some resource that's the problem.

[Rails] Redirect loop

2010-08-11 Thread Pale Horse
I have one record in a database that is encountering a redirect loop. When I point my browser to "www.sitenamehere.co.uk/case_studies/1", it displays a redirect loop error message. When I point my browser to "www.sitenamehere.co.uk/case_studies/2", it does not. Now, when I point my browser to "w

[Rails] Re: FOR or EACH?

2010-08-06 Thread Pale Horse
paul h wrote: > > Can't remember which book I saw it in (possibly Metaprogramming Ruby) > but at the beginning there is a statement along the lines of: > > Think of an array. Now think of accessing that array. If your first > thought is a for loop then you need to read more about Ruby, if your > f

[Rails] Re: Re: Re: how to deal with gender

2010-08-04 Thread Pale Horse
Robert Walker wrote: > > Pale Horse wrote: >> I tend to normalise as often as possible, and I do agree with you >> Robert. But http://c2.com/cgi/wiki?YouArentGonnaNeedIt also raises a >> very good point. > > Given that the primary reason for flattening da

[Rails] Re: Re: Re: how to deal with gender

2010-08-04 Thread Pale Horse
Robert Walker wrote: > > I definitely agree that there are cases where breaking normalization for > other gains is desirable. I just don't completely agree that this is one > of those cases. In this case following out to 3NF is beneficial. It > would provide for a more flexible and more elegant

[Rails] Re: FOR or EACH?

2010-08-04 Thread Pale Horse
Marnen Laibow-Koser wrote: > The for loop in C is like the for loop in BASIC, not the for...in loop > in Ruby. Ruby's for...in is like the for...in (or foreach) in Perl, > PHP, or recent versions of Java. Despite the use of the same keyword, > they're two very different constructs. > >> >>>

[Rails] Re: FOR or EACH?

2010-08-04 Thread Pale Horse
Marnen Laibow-Koser wrote: > Pale Horse wrote: >> When looping through arrays. What'd you argue to be good (or best) >> practice? >> >> <% for something in @lots_of_things %> >> <%= something.name %> >> <% end %> >>

[Rails] FOR or EACH?

2010-08-04 Thread Pale Horse
When looping through arrays. What'd you argue to be good (or best) practice? <% for something in @lots_of_things %> <%= something.name %> <% end %> <% @lots_of_things.each do |something| %> <%= something.name %> <% end %> I've read mixed opinions on this small topic. Some say that FOR loops ar

[Rails] Re: SystemExit: exit

2010-08-04 Thread Pale Horse
Robert Walker wrote: > > Pale Horse wrote: >> ActionView::TemplateError (SystemExit: exit: SELECT * FROM >> product_stocklevels WHERE (product_stocklevels.product_id = 831 AND >> (size = 'W44 L 32' AND stock > 0)) LIMIT 1) >> >> Before I pa

[Rails] Re: Re: Languages

2010-08-03 Thread Pale Horse
Marnen Laibow-Koser wrote: > Pale Horse wrote: > [...] >> How effective and accurate are the I18N translation solutions? More-so >> than members of the foreign-speaking countries themselves that my client >> is in contact with? > > The Rails I18N modules are not t

[Rails] Re: Re: Languages

2010-08-03 Thread Pale Horse
Marnen Laibow-Koser wrote: > > Rails I18N is not "really nice". I recommend fast_gettext instead. > >> If you think that translate an application to 6 different languages >> doesn't need an elegant and easy-to-maintain solution, then you're in >> trouble. > > Agreed. > Or is your question

[Rails] Re: Languages

2010-08-03 Thread Pale Horse
Robert Walker wrote: > Pale Horse wrote: >> My client has a translator and wants a lot of his page content to be >> translated into 6 different languages. >> >> When a user selects their language on the front end, it need to alter >> the Page content, Page title

[Rails] Languages

2010-08-03 Thread Pale Horse
My client has a translator and wants a lot of his page content to be translated into 6 different languages. When a user selects their language on the front end, it need to alter the Page content, Page title and Navigation title. I've made alternate columns in my database for the other languages.

[Rails] SystemExit: exit

2010-08-03 Thread Pale Horse
ActionView::TemplateError (SystemExit: exit: SELECT * FROM product_stocklevels WHERE (product_stocklevels.product_id = 831 AND (size = 'W44 L 32' AND stock > 0)) LIMIT 1) Before I paste more code, has anyone come across this before? -- Posted via http://www.ruby-forum.com/. -- You received thi

[Rails] Re: Re: Re: how to deal with gender

2010-07-30 Thread Pale Horse
Peter Hickman wrote: > > I also note that you are omitting titles and suffixes such as "Queen > Elizabeth II" who is also called "Elizabeth Alexandra Mary Windsor". > Or even "Hank Williams Jr" or "Hank WIlliams III" or "Sir Robert > Geldof" > > Some people have only one name which is neither a fo

[Rails] Re: Re: how to deal with gender

2010-07-30 Thread Pale Horse
bingo bob wrote: > > I realised that it's best to ignore the "one in a million" scenario, and > do what works in 99.9% of cases. "All that is complex is not useful. All that is useful is simple." As I said in my initial reply, you were overcomplicating it. -- Posted via http://www.ruby-forum.co

[Rails] Re: Re: how to deal with gender

2010-07-30 Thread Pale Horse
bingo bob wrote: >> An unlimited amount? > > Well yes, I believe so. In the vast majority of cases people just have > firstname surname, also firstname middlename surname. But in essence > they could have 100 middle names; although it's a little unlikely I > don't believe there are legal constr

[Rails] Re: Re: how to deal with gender

2010-07-30 Thread Pale Horse
bingo bob wrote: > > Horseman. > > Thanks for this. > > Great. > > But you can have multiple middle names! An unlimited amount? In that case, you might consider storing the entered forenames and middles names into separate tables and creating a suggestion tool. I recommend, taking a look at

[Rails] Re: Progress bar for a form containing a file

2010-07-30 Thread Pale Horse
Lily ^_^ wrote: > Hi, > > I have a form that contains a file field. > > Since the file can be rather big, I would like to display a progress bar > after the user clicks the submit button on the page, so he can see the > progress of the upload. > > I've no idea how to do that, so I search on Goog

[Rails] Re: Re: how to deal with gender

2010-07-30 Thread Pale Horse
bingo bob wrote: > > The names would be generated by the user, they are proposed new baby > names. The surname of the baby is of course fixed but needs to be > entered, it is that of the parents. Hope that makes sense. > > Amazing how much there is to think about from a seemingly trivial job!

[Rails] Re: migration numbers

2010-07-30 Thread Pale Horse
Frederick Cheung wrote: > On Jul 30, 10:36�am, Dis Tec wrote: >> Why do the migration numbers not appear. I am following the famous depot >> example, but I am finding that when I migrate the database using rake >> db:migrate I get a createproducts file with a long integer string before >> the .rb

[Rails] Re: migration numbers

2010-07-30 Thread Pale Horse
Dis Tec wrote: > Why do the migration numbers not appear. I am following the famous depot > example, but I am finding that when I migrate the database using rake > db:migrate I get a createproducts file with a long integer string before > the .rb file, i.e. 20100730085920_create_products.rb. How do

[Rails] Re: Re: how to deal with gender

2010-07-30 Thread Pale Horse
Are names generated by the user or do they see a list that *you* have entered into the assumed database? -- 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 ruby

[Rails] Re: Tags not being saved into the database

2010-07-30 Thread Pale Horse
Stephan Wehner wrote: > >> Apologies, using select_tag "article[tag_list]" sufficiently fixes this >> problem. >> >> Thank you for your input. > > Yes, that looks like the "right way". Except that the helper should be > able to generate that 'select_tag' with "f.select 'tag_list'" > > Are you

[Rails] Re: Tags not being saved into the database

2010-07-30 Thread Pale Horse
Stephan Wehner wrote: > > Stephan Wehner wrote: > > I think you need to add something like, > > @article.tag_list << params[:tags] > @article.save > > (Not the right way, but it should then save; sorry a bit late for me > over here) > > Stephan > Apologies, using select_tag "article[tag_lis

[Rails] Re: Tags not being saved into the database

2010-07-30 Thread Pale Horse
Frederick Cheung wrote: > > On Jul 30, 9:15�am, Pale Horse wrote: > >> knew it shouldn't have any effect. > select_tag "tags" definitely won't work though. Indeed, you're right. I made the change to: select_tag "article[tags]" > What

[Rails] Re: Tags not being saved into the database

2010-07-30 Thread Pale Horse
Stephan Wehner wrote: > Pale Horse wrote: >> Stephan Wehner wrote: >>> >>> Could it be that your template should say >>> >>> <%= f.select "tags", ... %> >>> >>> and not >>> >>> <%= select_tag &

[Rails] Re: Tags not being saved into the database

2010-07-30 Thread Pale Horse
Stephan Wehner wrote: > > Could it be that your template should say > > <%= f.select "tags", ... %> > > and not > > <%= select_tag "tags", ... %> > > > Stephan Again, I've already checked. That was a desperate attempt by me as I knew it shouldn't have any effect. -- Posted via http://www.r

[Rails] Re: Tags not being saved into the database

2010-07-30 Thread Pale Horse
Frederick Cheung wrote: > On Jul 29, 3:53�pm, Pale Horse wrote: >> � � <%= select_tag "tags", "Value 1Value >> >> For what reason would this value not be saved into the database? >> > >> I'm using acts_as_taggable_on :tags in my Article

[Rails] Tags not being saved into the database

2010-07-29 Thread Pale Horse
Why am I encountering this situation? I'm using the following code in my article form: <% form_for [:admin, @article] do |f| %> <%= f.error_messages %> <%= f.label "Tags" %> <%= select_tag "tags", "Value 1Value 2Value 3Value 4Value 5Value 6" %> <%= f.submit "Submit" %> <% en

[Rails] Re: Re: Dynamic Google Maps

2010-07-29 Thread Pale Horse
Marnen Laibow-Koser wrote: > Pale Horse wrote: > [...] >> Installing the plugin from that port causes an error: >> >> script/plugin install http://github.com/queso/ym4r-gm >> + ./opensearch.xml >> Plugin not found: ["http://github.com/queso/ym4r-gm"

[Rails] Re: Rescuing Errors

2010-07-28 Thread Pale Horse
Marnen Laibow-Koser wrote: > > Hoptoad is amazing (we use it at work), but if you don't want to spend > the money, ExceptionNotifier is fine. > > Best, > --  > Marnen Laibow-Koser > http://www.marnen.org > mar...@marnen.org > > Sent from my iPhone Thank you, Marnen. I'll investigate both of tho

[Rails] Re: Rescuing Errors

2010-07-28 Thread Pale Horse
Andy Jeffries wrote: > > Hoptoad > > -- > Andy Jeffries > http://andyjeffries.co.uk/ #rubyonrails #mysql #jquery > Registered address: 64 Sish Lane, Stevenage, Herts, SG1 3LS > Company number: 5452840 Interesting... Thank you. -- Posted via http://www.ruby-forum.com/. -- You received this

[Rails] Rescuing Errors

2010-07-28 Thread Pale Horse
Ideally, what I need is a method of rescuing ALL errors that can occur on a site by sending those errors (including the time they occurred) to a specified address. What would you advise? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Goo

[Rails] Re: Re: Dynamic Google Maps

2010-07-28 Thread Pale Horse
Patrick Robertson wrote: > > I assume this is a result of me missing subversion. Is there another way to > install this plugin. > > Alternatively, can anyone tell me any better ways of finding the geocode from > an address or postcode? > > http://github.com/queso/ym4r-gm is a port onto github t

[Rails] Re: Dynamic Google Maps

2010-07-23 Thread Pale Horse
a = Geokit::Geocoders::YahooGeocoder.geocode "#{ModelName.first.address}" a.ll The above works in my console and returns the latitude and longitude as requested. I cannot get this to work in my (development) application. When I attempt to run "script/plugin install svn://rubyforge.org/var/svn/

[Rails] Re: Dynamic Google Maps

2010-07-22 Thread Pale Horse
Patrick Robertson wrote: > You can use geokit (http://github.com/andre/geokit-gem) + ( > http://github.com/andre/geokit-rails) to geocode the story location and > then > use the YM4R-GM plugin to display the geocoded locations on a google map > ( > http://github.com/queso/ym4r-gm) . > > This art

[Rails] Re: Displaying the sum

2010-07-22 Thread Pale Horse
Abder-Rahman Ali wrote: > Thanks Pale, cannot I use CSS for that. I'm actually not aware of > Javascript. Do no not use CSS for this; CSS is for styling your page. If you're not familiar with JavaScript, can I suggest you start here: http://w3schools.com/js/default.asp -- Posted via http://www

[Rails] Re: Displaying the sum

2010-07-22 Thread Pale Horse
Abder-Rahman Ali wrote: > I'm creating a very simple Rails application where I enter "First > number" and then "Second number" and get the result in the "Sum". > > Those are some files: > > show.html.erb: http://pastie.org/private/1cydign77xnijlrb7mjvng > _form.html.erb: http://pastie.org/private

[Rails] Dynamic Google Maps

2010-07-22 Thread Pale Horse
My Rails application (Rails: V 2.1.0, Ruby: V 1.8.6) has on it, the ability for users to submit stories with their address information, which *will* be atomised into appropriate fields. A front end form allows users to submit stories, these stories are saved into a database table. They are then ap

[Rails] Re: newbie: what is preferred approach for including javascript files?

2010-07-13 Thread Pale Horse
Lille wrote: > > Hi, > > What is the cost of not cacheing javascript? Slower retrieval of the included files. > If that cost is serious, > do I prefer to selectively include javascript files only for view > where they are needed? In other words I see four options: http://guides.rubyonrails.org/

[Rails] Re: Re: Re: Re: Re: Re: Order form: quantity fields

2010-07-06 Thread Pale Horse
Colin Law wrote: >>> Actually I think maybe it would be worthwhile knowing what your model >>> relationships are. �If you have the model relationships right then you >>> can do clever things with nested forms. �See >>> http://railscasts.com/episodes/196-nested-model-form-part-1 for >>> example. >

[Rails] Re: Re: Re: Re: Re: Order form: quantity fields

2010-07-06 Thread Pale Horse
Colin Law wrote: > On 6 July 2010 13:13, Pale Horse wrote: >> http://pastie.org/1032538 > > Once again you have snipped all the content so this will make no sense > to anyone reading it without referring back to previous messages. Sorry, but they can always refer to this forum

[Rails] Re: Re: Re: Re: Order form: quantity fields

2010-07-06 Thread Pale Horse
http://pastie.org/1032538 -- 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 unsubscribe from this group, send email to ru

[Rails] Re: Re: Re: Order form: quantity fields

2010-07-06 Thread Pale Horse
Colin Law wrote: > On 6 July 2010 12:20, Pale Horse wrote: >> >> Products >> <% for products in Product.all(:conditions => "display=1") %> >> <%= products.name %> <%= text_field :order, :product_quantity %> >> <% end %> >

[Rails] Re: Re: Order form: quantity fields

2010-07-06 Thread Pale Horse
Colin Law wrote: > On 6 July 2010 12:00, Pale Horse wrote: >>> have got a form to display then work out how to get the list of >>> functionality, testing and so on. Even if they do not seem to be >> and mailer models and views for this in particular, would appear. >

[Rails] Re: Order form: quantity fields

2010-07-06 Thread Pale Horse
Colin Law wrote: > On 6 July 2010 11:33, Pale Horse wrote: >> >> I need some assistance to get this working. I'm sure you can help, >> whether it be directly or providing me with some documentation on this >> particular topic. > > Start with the simple

[Rails] Order form: quantity fields

2010-07-06 Thread Pale Horse
The situation is: I have a Product table with data. I require a form. The form requires a list of Products that have a text field opposite where the user can specify a limitless amount of each product. The form will not relate to a resource. It should send mail to a specified address with the info

[Rails] Re: Booleans on new records.

2010-07-01 Thread Pale Horse
As I have said, I've realised the problem is not with the controller code that's under discussion but with a lib file that takes precedence over it. Conversing more on the matter would be an exercise in futility, however. That said, Marnen & Robert, I will read that Wiki and have absorbed what y

[Rails] Re: Booleans on new records.

2010-07-01 Thread Pale Horse
Robert Walker wrote: > Pale Horse wrote: >> My controller code can be seen here: >> >> http://pastie.org/1026480 > > Oh, where to begin. Unless I'm completely daft, I see only one single > line in your new method that belongs in a "new" action. I

[Rails] Booleans on new records.

2010-07-01 Thread Pale Horse
I have a array of Projects, which contains all Projects that have their 'display' object set to 1 (true). The problem is: when I create a new record, I tried changing the value of 'display' to false. This did not change the value as false when it entered the database. In contrast to this, when I e

[Rails] Re: CSV Upload Issue

2010-06-24 Thread Pale Horse
Rob Biedenharn wrote: > > The call to .save the model is outside of the loop. > > You should indicate which version of ruby you're using as the > implementation of CSV changed between 1.8 and 1.9 (the former > FasterCSV replaced the old CSV in the standard library for 1.9 and > assumed the shorter

[Rails] CSV Upload Issue

2010-06-23 Thread Pale Horse
CSV: http://pastie.org/1015772 Controller: http://pastie.org/1015773 Why is it that it's only saving the record for "EFG5"? I'm obviously missing something. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails:

[Rails] Re: Re: Interpreter Problems

2010-06-17 Thread Pale Horse
Colin Law wrote: > > Googling for the error string found numerous hits suggesting that this > is a problem with MySQL version 5.1 on Vista, and reverting to 5.0 > fixed it. Are you on 5.1? > > Colin That, I have already tried with no success. -- Posted via http://www.ruby-forum.com/. -- You

[Rails] Re: Interpreter Problems

2010-06-17 Thread Pale Horse
Colin Law wrote: > On 17 June 2010 12:17, Pale Horse wrote: >> I really aren't sure why but my interpreter continues to fail after an >> unknown amount of requests or time on my local (home) computer. I've >> tried following instructions from people who have encou

[Rails] Interpreter Problems

2010-06-17 Thread Pale Horse
I really aren't sure why but my interpreter continues to fail after an unknown amount of requests or time on my local (home) computer. I've tried following instructions from people who have encountered similar problems with no success. Is it necessary for me to provide you with version details for

[Rails] Re: Forcing helper like link_to to use single quotes

2010-06-16 Thread Pale Horse
Marnen Laibow-Koser wrote: > > That's not true. The OP seems to be talking about the quotation marks > in the generate HTML, not in the Ruby source code. > > > > Best, > -- > Marnen Laibow-Koser > http://www.marnen.org > mar...@marnen.org It would appear I've been misguided. -- Posted via ht

[Rails] Re: Forcing helper like link_to to use single quotes

2010-06-16 Thread Pale Horse
Sharkie Landshark wrote: > > For example, I want rather than > > I want to maintain consistency with style. > > Can this be done? > > Also, I am trying to use Rails 3.0. > > Sharkie I would not recommend using single quotations over double. One argument against using single quotes is that y

[Rails] Re: firebug jQuery undefined message in rails app

2010-06-16 Thread Pale Horse
First, try: "" Instead of "" Else: "javascript_include_tag :all" You can set :recursive => true if you want Rails to search all subdirectories of public/javascripts. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Rub

[Rails] Re: ruby/lib/ruby/site_ruby/1.8/rubygems.rb:270:in `activate': u

2010-06-16 Thread Pale Horse
Mamadou Touré wrote: > > Hi folks, > > I'm getting the following error while trying to start the Webrick serve > on a old project that I just checked out from our svn. Could you tell me > what's wrong ? > > ruby/lib/ruby/site_ruby/1.8/rubygems.rb:270:in `activate': undefined > method `map' for ni

[Rails] Re: Different each iteration

2010-06-16 Thread Pale Horse
Marnen Laibow-Koser wrote: > > There's also in_groups_of. > > > Best, > -- > Marnen Laibow-Koser > http://www.marnen.org > mar...@marnen.org I'd forgotten about that method. In addition, you can each_slice(integer) to divide an array. Though, 'enumerator' is required in your Active Record mod

[Rails] Re: Ruby on Rails Analyst/Programmers, Glasgow.

2010-06-16 Thread Pale Horse
Deirdre Shell wrote: > > PH, Thank you for the reply. I am trying to assess how available A/Ps > will be hence this question. What's API mean here? The company already > use RoR, they are looking for more developers, that's where I have come > in. > > Deirdre Firstly, the availability of Ro

  1   2   >