[Rails] Re: How to hook ActionController when plugin init in development mode?

2009-05-26 Thread 冷血儿
I tried that way. It doesn't work even first request. 2009/5/27 Neo > > 试试ActionController::Base.send :inlcude,AcPlugin > > > > -- > 明天会更好 > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk"

[Rails] Re: Java kicks Rails's butt - it says right here!

2009-05-26 Thread PP Junty
Steve, you don't need to go too far, just take the subtitle and the very first sentence: "This article demonstrates that Java is more productive than Ruby" "This article tries to demonstrate that Java can be more productive than Ruby." -- Posted via http://www.ruby-forum.com/. --~--~--

[Rails] Re: Searching/Sorting an Array of Hashes

2009-05-26 Thread Robert Scott
Sorry, Tim. I should have clarified. This is the line that is having issues: @hits << hash[:id] if hash.values.include?(name) Specifically, the .values part. timr wrote: > It looks like a typo got introduced as you were moving the method into > your rails app. There is no values_at call in my

[Rails] Re: Cookie overflow?

2009-05-26 Thread NAYAK
Hi, Your sessions (by default in cookie) needs to be moved to Active record store or memcache store to fix this issue. For Databased sessions: config.action_controller.session_store = :active_record_store You need to create the session table as below rake db:sessions:create rake db:migrate OR Fo

[Rails] Re: do you think we should make <%= # comment %> not cause

2009-05-26 Thread Jian Lin
Salil Gaikwad wrote: > I Commented code in erb in following ways > > <%# This is Comment %> > > <%# > This is Comment > %> > > <%#= This is Comment %> > > <%#= > This is Comment > %> i see. that's smart. then we don't need <%= #comment %> to work. but if it can, i think it might be go

[Rails] Cookie overflow?

2009-05-26 Thread Mk 27
I altered a controller to use a session variable in place of an instance variable, and this happened Status: 500 Internal Server Error ActionController::Session::CookieStore::CookieOverflow In the docs, it does say: "If you have more than 4K of session data [...] pick another session store." W

[Rails] Re: do you think we should make <%= # comment %> not cause error

2009-05-26 Thread Salil Gaikwad
Colin Law wrote: > In addition I meant to say that according to the ticket link, <%=# and > <%= # > are also not valid erb comments. > Colin > > 2009/5/24 Colin Law I Commented code in erb in following ways <%# This is Comment %> <%# This is Comment %> <%#= This is Comment %> <%#= This i

[Rails] Re: Searching/Sorting an Array of Hashes

2009-05-26 Thread timr
It looks like a typo got introduced as you were moving the method into your rails app. There is no values_at call in my method, perhaps you accidentally tab completed and inadvertently introduced the _at. Good luck. Tim On May 26, 2:07 am, Robert Scott wrote: > Tim, > > Thanks again for the deta

[Rails] Re: How to hook ActionController when plugin init in development mode?

2009-05-26 Thread Neo
试试ActionController::Base.send :inlcude,AcPlugin 2009/5/27 冷血儿 > Hi all~ > I want to add some methods to ActionController. And I generate a > plugin. Although this example looks like strange. > > init.rb > require "ac_plugin" > ApplicationController.send(:include, AcPlugin) > > lib/ac_plugin.rb >

[Rails] Nested Forms with has_many associations with validations

2009-05-26 Thread Alex Sharp
I want to have a parent model that I can add child objects (via a has_many association) using the rails 2.3 nested form syntax. However, it seems like rails throws an error during validation of the parent model if I have a validates_presence_of :parent_id defined in the child model. Is the only s

[Rails] Rails: concurrency question

2009-05-26 Thread Steve Hull
If I have a singleton class (by using the Singleton mixin), I understand it's thread-safe in that it ensures only a single instance of this class will be created (by putting a mutex around the instance method). BUT (in theory), the instance methods of my singleton instance could be accessed concu

[Rails] multi_db

2009-05-26 Thread erik
I would like to use the multi_db gem to connect to multiple slave databases. It looks pretty easy as long as your app has a single application database. For example: production: adapter: mysql database: a_production username: blahblah password: host: 10.0.0.1 port: 3306 p

[Rails] Re: How to keep persistent socket connections?

2009-05-26 Thread Steve Hull
Roy, thanks!! That did help. I also found that a solution to my problem: I used a singleton connection manager. This avoided all my problems. :) I have a question regarding thread safety, but I think I'll post a new thread for it. The general gist is: if I have a singleton class (by using

[Rails] Re: Java kicks Rails's butt - it says right here!

2009-05-26 Thread Steve Hull
Phlip wrote: > it says right here! well if it said it on the interwebs, then it *must* be true. lol in all seriousness, take a look at first few paragraphs. there are an awful lot of qualifiers. ie, "this article *tries* to demonstrate"... "I prefer" comes up a lot... At the end of the day

[Rails] Re: Java kicks Rails's butt - it says right here!

2009-05-26 Thread Marnen Laibow-Koser
Phlip wrote: > http://java.sys-con.com/node/965189 > > I am certainly going back to Java, just as soon as I figure out how to > configure > Tomcat. :) > > Until then, anyone care to take on this logic? Has anyone here used Java > the way > they say they should? I like what he showed of the

[Rails] Re: Can I update session variable in a new thread?

2009-05-26 Thread Sudhi Kulkarni
Frederick Cheung wrote: > On May 26, 10:20�am, Sudhi Kulkarni > wrote: >> session[:executing] it is not updated to "done". Is there a problem if I >> try to update session variable in a different thread? >> > > If this ends up setting the session after rails has closed out the > session (ie push

[Rails] Java kicks Rails's butt - it says right here!

2009-05-26 Thread Phlip
http://java.sys-con.com/node/965189 I am certainly going back to Java, just as soon as I figure out how to configure Tomcat. Until then, anyone care to take on this logic? Has anyone here used Java the way they say they should? -- Phlip --~--~-~--~~~---~--~

[Rails] Re: Two link Questions

2009-05-26 Thread Sean Six
If I try this: <%= link_to(@article.title, @article.url) %> I almost get it. Say the title is "google" and the url is www.google.com; I get a button that says google, but it links to localhost:articles/1/www.google.com, not www.google.com -- Posted via http://www.ruby-forum.com/. --~--~--

[Rails] How to hook ActionController when plugin init in development mode?

2009-05-26 Thread 冷血儿
Hi all~ I want to add some methods to ActionController. And I generate a plugin. Although this example looks like strange. init.rb require "ac_plugin" ApplicationController.send(:include, AcPlugin) lib/ac_plugin.rb module AcPlugin def index render :text => "Hello!" end end And then I ope

[Rails] Re: Developing with GNU Screen

2009-05-26 Thread Marnen Laibow-Koser
Hunt Jon wrote: > I hear a lot say GNU Screen is better than Terminal's tabs. > > But I cannot find a real use case. [...] Not that this is a Rails issue, but... Screen is great if you're using a text-only environment (for example, within an ssh session), or if you're doing a lot of attaching

[Rails] Re: require_role on a per action basis

2009-05-26 Thread Marnen Laibow-Koser
BenH wrote: > Consider restful_authentication Yup. Or authlogic. > and rolerequirement > http://code.google.com/p/rolerequirement/ Or rails_authorization. There are probably other plugins as well -- these are *very* common tasks. Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@mar

[Rails] Developing with GNU Screen

2009-05-26 Thread Hunt Jon
I hear a lot say GNU Screen is better than Terminal's tabs. But I cannot find a real use case. I can understand that ability to copy and paste is useful. But in terms of session attaching/detaching, all the sessions are gone if I restart my Mac. I'm using Terminal with several tabs open (e.g.,

[Rails] Re: cookies are mandatory for Rails app?

2009-05-26 Thread Marnen Laibow-Koser
Darrik Mazey wrote: [...] > I assume that users will have the option to disable HTML 5 browser-local > storage. I also assume that people who turn off cookies will most > likely disable local storage. That is an excellent point. Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen

[Rails] Re: List all field names on a PDF using iText from Rails

2009-05-26 Thread Dan Sadaka
Benjamin, Thanks for the tip. Here is the complete code. The big hangup was the .to_string. I kept trying to use .to_s thinking Rjb would translate for me. NOT! Note that the output can be cut and pasted into a db migration file. *-

[Rails] Re: cookies are mandatory for Rails app?

2009-05-26 Thread Darrik Mazey
Robert Walker wrote: > SpringFlowers AutumnMoon wrote: >> is it true that Rails depend on cookies? It seems that flash is a part >> of session, and session uses cookies... so when i disable cookie in >> Firefox, what was working became >> >> ActionController::InvalidAuthenticityToken >> >> so is

[Rails] Re: routs question

2009-05-26 Thread Darrik Mazey
Sam Ginko wrote: > I would like to redirect a user to the index page if they type in a > page that does not exist on my site. How do I go about that? The following as your last route, will catch any other requests that don't match any other routes. map.blanket_route '*path', :controller => 'wh

[Rails] Re: a way that helper functions not produce XHTML but HTML?

2009-05-26 Thread Marnen Laibow-Koser
Rimantas Liubertas wrote: [snip] Wow, where to begin? Your references are very interesting, but as I read them, it seems to me that their authors have leapt to conclusions from a farrago of spurious "facts" and unwarranted assumptions. > It is very unfortunate, that RoR chose this path. Espec

[Rails] Re: require_role on a per action basis

2009-05-26 Thread BenH
Consider restful_authentication and rolerequirement http://code.google.com/p/rolerequirement/ On May 26, 4:01 pm, Mike Buckley wrote: > I am working on an app that has three roles (user, admin, business). I > have the situation where all three roles interact with the same > controller, but have

[Rails] routs question

2009-05-26 Thread Sam Ginko
I would like to redirect a user to the index page if they type in a page that does not exist on my site. How do I go about that? -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Gro

[Rails] IIS, Net::HTTP::Get, and Basic Authentication

2009-05-26 Thread BenH
I'm getting a 401.2 from IIS You do not have permission to view this directory or page using the credentials that you supplied because your Web browser is sending a WWW-Authenticate header field that the Web server is not configured to accept. The sysadmin says that basic auth is enabled. Is ther

[Rails] Re: Active Resource custom method using POST

2009-05-26 Thread BenH
I may just go to the command line with curl - that seems to work without a hitch. Also, for anyone looking at creating a POST body, the code I posted previously for converting a hash to POST body can be completely replaced with {hash}.to_param. In my case: body = input.to_param Good luck - On Ma

[Rails] Re: String Manipulation

2009-05-26 Thread Ruby One
BenH wrote: > Try this: > words = "Kid games need to be both fun and educational. Aimed at ages > pre-K through middle school, safe environment to discover their > abilities and learn new skills with interactive and fun computer > games. Our games build skills in math, logic, memory, vocabulary, >

[Rails] Re: String Manipulation

2009-05-26 Thread BenH
Try this: words = "Kid games need to be both fun and educational. Aimed at ages pre-K through middle school, safe environment to discover their abilities and learn new skills with interactive and fun computer games. Our games build skills in math, logic, memory, vocabulary, alphabet, spelling, geo

[Rails] require_role on a per action basis

2009-05-26 Thread Mike Buckley
I am working on an app that has three roles (user, admin, business). I have the situation where all three roles interact with the same controller, but have access to different actions. Some actions are authorized for 2 roles (admin, business), and others are only authorized for one role (administr

[Rails] Re: String Manipulation

2009-05-26 Thread Marnen Laibow-Koser
Ruby One wrote: [...] > > I am newbee so do not much syntax and loops can you please help me i > that. > > thanks Check out the "pickaxe book" (Programming Ruby, available on the Web). Pay particular attention to regular expressions, the String class (especially the split and join methods),

[Rails] Re: help urgent please

2009-05-26 Thread Marnen Laibow-Koser
Ruby One wrote: > > > Hi all, > > Help needed urgently You've already started a thread on this topic. No need to do so again. -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Gr

[Rails] Re: String Manipulation

2009-05-26 Thread Ruby One
Marnen Laibow-Koser wrote: > Ruby One wrote: > [...] >> please help > > Just break the string up and insert the => stuff. What exactly is the > problem? > > Best, > -- > Marnen Laibow-Koser > http://www.marnen.org > mar...@marnen.org I am newbee so do not much syntax and loops can you ple

[Rails] Re: iso-8859-1 no effect in browser

2009-05-26 Thread Franco Catena
Yes, i use it a lot, but in this form: record.errors.add attr, :invalid # or any other And then in the config/locales/es.yml es: activerecord: errors: messages: invalid: "no es válido" # Custom for one model models: somemoder: attributes:

[Rails] Re: String Manipulation

2009-05-26 Thread Marnen Laibow-Koser
Ruby One wrote: [...] > please help Just break the string up and insert the => stuff. What exactly is the problem? Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You rece

[Rails] Re: ruby and MySql

2009-05-26 Thread William Downs
Hey guys - that was a fast answer - with your help, and with this link http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/249986 I got it running - MANY MANY thanks Glorifindal -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You recei

[Rails] help urgent please

2009-05-26 Thread Ruby One
Hi all, Help needed urgently Example: this could be the string. Kid games need to be both fun and educational. Aimed at ages pre-K through middle school, safe environment to discover their abilities and learn new skills with interactive and fun computer games. Our games build skills in math,

[Rails] Re: Auto complete onclick

2009-05-26 Thread Sazima
Rodrigo, You can either use a hidden field for the ID or follow the approach covered by Ryan Bates in the following railscast: http://railscasts.com/episodes/102-auto-complete-association Cheers, Sazima On May 25, 9:34 pm, Rodrigo Felix wrote: > I'd like to know how I can put the id in a fiel

[Rails] Re: String Manipulation

2009-05-26 Thread Ruby One
Ruby One wrote: > Frederick Cheung wrote: >> On May 26, 10:01�pm, Ruby One >> wrote: >>> Hi all, >>> >>> Help needed urgently >> >> Maybe it's just me, but I think that in your hurry you've neglected to >> describe what it is you want to do. Replace carriage returns with => >> \n<= ? > > its li

[Rails] Re: I need support it is urgent

2009-05-26 Thread BenH
filemodel.extension = File.extname("/some/path/myfile.xls") # output is ".xls" Do you mean instead that you would like to store an xls file? If so check out acts_as_attachment, attachment_fu or file_column plugins. Ben On May 26, 3:39 am, railsrao wrote: > Hi every one > I need help , i have a

[Rails] Re: String Manipulation

2009-05-26 Thread Ruby One
Frederick Cheung wrote: > On May 26, 10:01�pm, Ruby One > wrote: >> Hi all, >> >> Help needed urgently > > Maybe it's just me, but I think that in your hurry you've neglected to > describe what it is you want to do. Replace carriage returns with => > \n<= ? its like after certain words i want t

[Rails] Duplicate joins when combining scopes and :include

2009-05-26 Thread Jónas Tryggvi Jóhannsson
Hi, I have an app using Rails 2.3.2 that chains together multiple scopes with joins and conditions on different tables. When I add :include to the finders that use these scopes, I get an Mysql::Error saying Not unique table/alias for the table that I'm including, and joining on in scopes. The jo

[Rails] Re: alias_method_chain :process

2009-05-26 Thread Frederick Cheung
On May 26, 7:40 pm, Jay wrote: > Hi, > > I'm trying to upgrade to rails 2.3.2 and need a little help figuring > something out. > > Our app uses the plugin asserts_valid_asset to test the welformedness > of HTML that is generated. > > This plugin extends test::unit::testcase by wanting to method

[Rails] Re: String Manipulation

2009-05-26 Thread Ruby One
BenH wrote: > Is the point of your post to display the text at fixed line widths? yes like after 10 words i want to put => and than in next line starts with <= and ends with => after 10 words and so on -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~--

[Rails] Re: String Manipulation

2009-05-26 Thread Frederick Cheung
On May 26, 10:01 pm, Ruby One wrote: > Hi all, > > Help needed urgently Maybe it's just me, but I think that in your hurry you've neglected to describe what it is you want to do. Replace carriage returns with => \n<= ? > > Example: this could be the string. > > Kid games need to be both fun an

[Rails] Re: String Manipulation

2009-05-26 Thread BenH
Is the point of your post to display the text at fixed line widths? On May 26, 2:01 pm, Ruby One wrote: > Hi all, > > Help needed urgently > > Example: this could be the string. > > Kid games need to be both fun and educational. Aimed at ages pre-K > through middle school, safe environment to d

[Rails] Re: ruby and MySql

2009-05-26 Thread Frederick Cheung
On May 26, 10:04 pm, William Downs wrote: > Hi there - new to RoR but very excited about it indeed - > > I have just manged to install everything. > > However, when I browse tohttp://localhost:3000/then click the "About > your application’s environment" - from the console I get : > >   Status:

[Rails] Re: ruby and MySql

2009-05-26 Thread BenH
Does the database exist that you are connecting to? #> mysqladmin create temp_development also ensure you have the mysql gem installed (current versions of rails require the native gem) #> sudo gem install mysql lastly make sure your project can communicate with the database rake db:migrate If

[Rails] date_select validate all fields selected

2009-05-26 Thread _thief_
Hi, date_select seems to behave rather strangely if :prompt => true or :empty => true and the user does not select all fields. It seems that by the time the birth_date field gets to validation, its filled with a Date object that has defaults set for empty fields. eg If a year is selected but mon

[Rails] ruby and MySql

2009-05-26 Thread William Downs
Hi there - new to RoR but very excited about it indeed - I have just manged to install everything. However, when I browse to http://localhost:3000/ then click the "About your application’s environment" - from the console I get : Status: 500 Internal Server Error no such file to load -- mysq

[Rails] String Manipulation

2009-05-26 Thread Ruby One
Hi all, Help needed urgently Example: this could be the string. Kid games need to be both fun and educational. Aimed at ages pre-K through middle school, safe environment to discover their abilities and learn new skills with interactive and fun computer games. Our games build skills in math, l

[Rails] Re: Capitalize first letter of each word

2009-05-26 Thread Benjamin Curtis
Indeed... I got wrapped around the axle of re-opening classes in Ruby and forgot to mention the Rails extensions. :) -- Benjamin Curtis http://railskits.com/ - Ready-made Rails code http://catchthebest.com/ - Team-powered recruiting http://www.bencurtis.com/ - Personal blog On Tue, May 26, 2009

[Rails] Re: library for URL parameters adding, removing, or replacing?

2009-05-26 Thread BenH
URL paramaters are usually passed as a hash, with that if a new key matches and existing key the new key/value pair will overwrite the existing key/value pair thus preventing duplicate entries. Ben On May 26, 11:47 am, Jian Lin wrote: > i think PHP doesn't have such simple functions yet...  doe

[Rails] Re: ruby 1.9.1, cygwin & rails 2.3.2: undefined method camelize

2009-05-26 Thread Conrad Taylor
Sent from my iPhone On May 26, 2009, at 12:21 PM, dmack wrote: > > I tried to get this working and ran into a problem: > > - latest cygwin > - ruby 1.9.1p129 (same problem with p0). install in /opt/ruby19 > - rails 2.3.2 > > 1) Installed ruby 1.9.1p129 with: --prefix=/opt/ruby19. No er

[Rails] Re: [ANN] ri_cal 0.5.0 Released

2009-05-26 Thread Rick DeNatale
I just updated it to 0.5.1, Just a change in the README to reflect publication on RubyForge, same code On Tue, May 26, 2009 at 3:41 PM, Rick DeNatale wrote: > ri_cal version 0.5.0 has been released! > > * > * > > A new Ruby implementation of RFC2445 iCalendar. > >

[Rails] Re: iso-8859-1 no effect in browser

2009-05-26 Thread tivrfoa
thansk Franco. it works on the view, but not work in the model (at least here) did you try to add a message in some model with accent? On May 26, 2:43 pm, Franco Catena wrote: > I create almost only spanish applications, all with Ñ ñ, á é and so > on, and use ONLY UTF-8. > > The meta directive

[Rails] Re: IRB fails to call some shell commands only on Windows

2009-05-26 Thread Umur Ozkul
Matt Jones wrote: > Now I understand. Yep, that's a known issue with templates: > https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/2531 > > --Matt Jones Relief to know that. I added warnings to http://conceptspace.wikidot.com/ and debugged the template to be free of commands

[Rails] Re: CAn u please tell wats the prob in runnning my project?

2009-05-26 Thread gm
where to get hmac-sha1 On May 25, 3:30 am, Julian Leviston wrote: > On 25/05/2009, at 4:46 PM, gm wrote: > > > > > [~/kallori]# rake db:migrate > > (in /home/gm/kallori) > > no such file to load -- hmac-sha1 > > Just hazarding a guess, I'd say you're missing ferret. which is   > relying on a hm

[Rails] [ANN] ri_cal 0.5.0 Released

2009-05-26 Thread Rick DeNatale
ri_cal version 0.5.0 has been released! * * A new Ruby implementation of RFC2445 iCalendar. The existing Ruby iCalendar libraries (e.g. icalendar, vpim) provide for parsing and generating icalendar files, but do not support important things like enumerating occur

[Rails] Re: a way that helper functions not produce XHTML but HTML?

2009-05-26 Thread Rimantas Liubertas
> Not really; the DOCTYPE still tells the browser that it's XHTML. DOCTYPEs do not matter in this case. Browsers do switch rendering modes depending on doctypes, but the only thing that influences the choice of parser is MIME type [1] > Most browsers have no problem.  IE is the exception, sort o

[Rails] Re: Capitalize first letter of each word

2009-05-26 Thread Philip Hallstrom
On May 26, 2009, at 11:48 AM, JannaB wrote: > > I am trying to capitalize first letter of each word in a string of > words, which is in a given string. I see there is a reference to this > at: > String#titleize is your friend... >> "this is some string. here is another! a question? oh my.".t

[Rails] Re: List all field names on a PDF using iText from Rails

2009-05-26 Thread Benjamin Curtis
Check out this code: http://github.com/jaywhy/pdf-stamper/tree/master I haven't used it, as it wasn't around when I needed it, so I wrote my own, but this code looks very similar to what I wrote, so it may work well for what you need. The highlighted line in this link shows how the fields can be l

[Rails] ruby 1.9.1, cygwin & rails 2.3.2: undefined method camelize

2009-05-26 Thread dmack
I tried to get this working and ran into a problem: - latest cygwin - ruby 1.9.1p129 (same problem with p0). install in /opt/ruby19 - rails 2.3.2 1) Installed ruby 1.9.1p129 with: --prefix=/opt/ruby19. No errors or problems. make install worked. 2) gem install rails No problem, rai

[Rails] Re: Capitalize first letter of each word

2009-05-26 Thread Benjamin Curtis
Well, those two methods won't give you what you want, if you really want to capitalize the first letter of every word in a sentence. Also, if you just want to capitalize the first letter of the string, the built-in capitalize method will do that for you: 'some string'.capitalize => 'Some string'

[Rails] Re: Two link Questions

2009-05-26 Thread mike
Just <%= link_to title, url %> greetings, mike 2009/5/26, Sean Six : > > I have the information stored in a table called articles. The title is > under "title" and the url under "url" > > I can use the auto_link method with url, for example: > <%= auto_link @article.url %> > > I want the button

[Rails] Re: dump and import MySQL table w/ accents

2009-05-26 Thread Jeffrey L. Taylor
Quoting BenH : > > Ensure your database.yml file has a line like: > > encoding: utf8 > Thank you. It has for over a year. The data dumped was UTF-8, but something is preventing it from being re-imported. Sigh, Jeffrey --~--~-~--~~~---~--~~ You received thi

[Rails] Capitalize first letter of each word

2009-05-26 Thread JannaB
I am trying to capitalize first letter of each word in a string of words, which is in a given string. I see there is a reference to this at: http://www.java2s.com/Code/Ruby/String/Addtwomethodtostringclasstocapitalizefirstletter.htm which states to add two method to string class to capitalize fi

[Rails] library for URL parameters adding, removing, or replacing?

2009-05-26 Thread Jian Lin
i think PHP doesn't have such simple functions yet... does Ruby have it? if in PHP, when we add a param to the URL $redirectURL = $printPageURL . "?mode=1"; it works if $printPageURL is "http://www.somesite.com/print.php";, but if $printPageURL is changed in the global file to "http://www.some

[Rails] alias_method_chain :process

2009-05-26 Thread Jay
Hi, I'm trying to upgrade to rails 2.3.2 and need a little help figuring something out. Our app uses the plugin asserts_valid_asset to test the welformedness of HTML that is generated. This plugin extends test::unit::testcase by wanting to method chain the process method. class Test::Unit::Tes

[Rails] Re: memcache for variables

2009-05-26 Thread BenH
Except in the collection you actually would put [u.name,u.id] On May 26, 11:33 am, BenH wrote: > in your config/environment/development.rb file (or whatever > environement your are configuring) > > config.cache_store = :mem_cache_store > > Depending on how much memory you want to consume you ca

[Rails] Re: memcache for variables

2009-05-26 Thread BenH
in your config/environment/development.rb file (or whatever environement your are configuring) config.cache_store = :mem_cache_store Depending on how much memory you want to consume you can either load your whole user model, the name to ID collection or just the users that log in. In the User

[Rails] Re: cookies are mandatory for Rails app?

2009-05-26 Thread Marnen Laibow-Koser
Robert Walker wrote: > SpringFlowers AutumnMoon wrote: >> Roderick van Domburg wrote: >> >>> So theoretically: no, Rails apps don't require cookies. But what are the >>> practical reasons to be concerned about them? [...] >> >> So I instantly disabled cookie on Firefox using Web Developer add-o

[Rails] Re: dump and import MySQL table w/ accents

2009-05-26 Thread BenH
Ensure your database.yml file has a line like: encoding: utf8 On May 26, 10:50 am, "Jeffrey L. Taylor" wrote: > I am switching to a composite primary key (string and user ID) from the Rails > conventional auto-incrementing integer primary ID.  The table is large (2.5 > million records) and I'd

[Rails] Re: cookies are mandatory for Rails app?

2009-05-26 Thread SpringFlowers AutumnMoon
Robert Walker wrote: >> that's the concern... turning off cookie broke my Rails app. > > Generally speaking, yes it will. Just like it will break almost any web > application Rails or otherwise. :) or to put it this way, if to make the Rails app work even when user turns off cookie, is there

[Rails] Re: manual access to session data outside of request?

2009-05-26 Thread Jonathan Rochkind
Frederick Cheung wrote: > 2.2 is a bit easier actually - > > Struct.new('FakeSession', :session_id) > fake_cgi_session = Struct::FakeSession.new('some session id') > > session = WhateverSessionStoreClass.new(fake_cgi_session) > session.restore > > Fred > Revisiting old history. Huh, I swear I

[Rails] Re: cookies are mandatory for Rails app?

2009-05-26 Thread Robert Walker
SpringFlowers AutumnMoon wrote: > Roderick van Domburg wrote: > >> So theoretically: no, Rails apps don't require cookies. But what are the >> practical reasons to be concerned about them? > > because i was trying a Rails app (from the book Simply Rails 2.0)... and > at the "Flash" part, (not

[Rails] dump and import MySQL table w/ accents

2009-05-26 Thread Jeffrey L. Taylor
I am switching to a composite primary key (string and user ID) from the Rails conventional auto-incrementing integer primary ID. The table is large (2.5 million records) and I'd rather not discard the contents. The composite_primary_key gem doesn't appear to support altering the table with a mig

[Rails] Re: iso-8859-1 no effect in browser

2009-05-26 Thread Franco Catena
I create almost only spanish applications, all with Ñ ñ, á é and so on, and use ONLY UTF-8. The meta directive between the head tags does all the magic. Regards. Franco Catena. On May 26, 12:19 pm, tivrfoa wrote: > tks! it didn't work in utf-8. if I use está (without the special > character)

[Rails] Re: Can't access http://local:3000/projectName/

2009-05-26 Thread Redpanda
Thanks for the help.I figured that out the day after I posted this and forgot to update my post. But this should be good for anyone else having the same issue. ~Redpanda On May 17, 5:50 am, Frederick Cheung wrote: > On May 17, 4:31 am, Redpanda wrote: > > > Hey, I'm new to RoR and have been ha

[Rails] local RAILS/RUBY connections (HUDSON VALLEY NY)? - repost

2009-05-26 Thread agilehack
Anyone from this group in or around Hudson Valley NY? Looking for some local connections or groups to learn with and from. (thanks to Marnen Laibow-Koser for his techvalleyrb suggestion) --~--~-~--~~~---~--~~ You received this message because you are subscribed to

[Rails] Re: button_to_remote syntax

2009-05-26 Thread Stephen Brown
Frederick Cheung wrote: > html options need to be in a second hash of options, ie > button_to_remote 'Foo', {...}, {...} > > Fred Thanks. Works like a charm. -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you a

[Rails] Re: local RAILS/RUBY connections?

2009-05-26 Thread agilehack
wow great, that was easy - I will join that group I think. Are you guys a part of it as well? I should have put Hudson Valley in the title of the post to catch more peoples eyes. On May 26, 12:43 pm, Marnen Laibow-Koser wrote: > agilehack wrote: > > Anyone from this group in or around Hudson V

[Rails] Re: local RAILS/RUBY connections?

2009-05-26 Thread Marnen Laibow-Koser
agilehack wrote: > Anyone from this group in or around Hudson Valley NY? Looking for > some local connections or groups to learn with and from. Yup! I live in Albany, and Jason Fox, who occasionally posts here, is also in this area. Check out http://www.techvalleyrb.org for the local users'

[Rails] Re: cookies are mandatory for Rails app?

2009-05-26 Thread SpringFlowers AutumnMoon
Roderick van Domburg wrote: > So theoretically: no, Rails apps don't require cookies. But what are the > practical reasons to be concerned about them? because i was trying a Rails app (from the book Simply Rails 2.0)... and at the "Flash" part, (not Adobe Flash), it talks about next action pa

[Rails] Re: Two link Questions

2009-05-26 Thread Sean Six
I have the information stored in a table called articles. The title is under "title" and the url under "url" I can use the auto_link method with url, for example: <%= auto_link @article.url %> I want the button to say the title field, but link to the url field. I thought it might be something

[Rails] Active Resource custom method using POST

2009-05-26 Thread BenH
I've written a small piece of code that is supposed to place an order in a order handling system. get, put and delete functions are working great but I cannot get post to function at all... the error I get back from the code below is 400 (bad request). I think it has something to do with the heade

[Rails] local RAILS/RUBY connections?

2009-05-26 Thread agilehack
Anyone from this group in or around Hudson Valley NY? Looking for some local connections or groups to learn with and from. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this

[Rails] Re: ID not primary key with not unique values

2009-05-26 Thread Andrew Timberlake
On Tue, May 26, 2009 at 6:11 PM, pepe wrote: > > Sorry for the re-post. Nobody has even answered "no, can't do". > > I have an ID column in a legacy table of type STRING and could contain > not unique values. Is there a way of disabling the convention of ID > being the primary key? How can I assi

[Rails] Re: ID not primary key with not unique values

2009-05-26 Thread Pardee, Roy
I believe the primary_key directive will tell AR what field to use as the actual PK. Something like: class MyClass < AR::Base primary_key :actual_pk_field_name end Hopefully AR would then then ignore the id field. -Original Message- From: rubyonrails-talk@googlegroups.com [ma

[Rails] ID not primary key with not unique values

2009-05-26 Thread pepe
Sorry for the re-post. Nobody has even answered "no, can't do". I have an ID column in a legacy table of type STRING and could contain not unique values. Is there a way of disabling the convention of ID being the primary key? How can I assign the values I need to the ID column without using SQL,

[Rails] Re: button_to_remote syntax

2009-05-26 Thread Frederick Cheung
On May 26, 4:40 pm, Stephen Brown wrote: above code, the :before is ignored > > So, I change the path to a :url hash: > <%= button_to_remote "Paid", :url => > has_paid_event_booking_path(booking, booking.event), :method => :post, > :before => "Effect.Fade('not_paid_" + booking.id.to_s + "')",:

[Rails] Re: IRB fails to call some shell commands only on Windows

2009-05-26 Thread Matt Jones
Now I understand. Yep, that's a known issue with templates: https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/2531 --Matt Jones On May 25, 4:21 pm, umuro wrote: > I discovered the problem after running a rails template on Windows. > After seeing the problem I opened IRB and fa

[Rails] Re: iso-8859-1 no effect in browser

2009-05-26 Thread tivrfoa
tks! it didn't work in utf-8. if I use está (without the special character), it display an interrogation symbol (?) Could someone try to use this => :message => 'está incorreto' in some validation to see if it works? How can I display "está"? tks --~--~-~--~~~---~--~

[Rails] button_to_remote syntax

2009-05-26 Thread Stephen Brown
Hey I'm trying to make a button_to_remote that also has an associated style. It works fine as a button_to: <%= button_to "Paid", has_paid_event_booking_path(booking, booking.event), :method => :post, :style => "background:url(/images/money_add.png) left no-repeat; padding-left: 15px" %> but

[Rails] Re: attachment_fu thumbnail not created

2009-05-26 Thread aa bb
aa bb wrote: > mr_robot wrote: >> hi just wondering if you solved this proble. i am having the same issue > > 'kay; same problem (thumbnails not being generated); > happened just by moving from a model to another (from > app/models/asset.rb to app/models/item.rb). > columns are just fine; but sti

[Rails] Re: attachment_fu thumbnail not created

2009-05-26 Thread aa bb
mr_robot wrote: > hi just wondering if you solved this proble. i am having the same issue 'kay; same problem (thumbnails not being generated); happened just by moving from a model to another (from app/models/asset.rb to app/models/item.rb). columns are just fine; but still getting the same proble

  1   2   >