[Rails] how to create local subroutines properly in rails?

2010-08-03 Thread ct9a
hi guys, Using breadcrumbs on rails (http://github.com/weppos/ breadcrumbs_on_rails), I have added a method, set_breadcrumb in my application controller. That will set up my home breadcrumb. In my other feedbacks controller, I have the same set_breadcrumb method (in a before_filter). The

[Rails] Complex associations

2010-08-03 Thread Trish
I am working on a project that has some complex table associations, and I am having a hard time declaring this association in a Model, and fear it can't be done. Here is an example of my issue... class StoreType ActiveRecord::Base; end class Store ActiveRecord::Base; end class Department

[Rails] Generating .mo with Rails 2.1.0

2010-08-03 Thread Bráulio Bhavamitra
Hello all, I'm a newbie to Ruby/Rails world, and also to the application I'm trying to use: Noosfero. The thing is, i'm trying to run 'rake makemo' with no success.. $/usr/bin/ruby1.8 -rconfig/boot -rgettext -rgettext/rails -rgettext/ utils -e 'GetText.create_mofiles(true, po, locale)'

[Rails] Rails3-beta4: Calling to_json on an ActiveRecord::Relation causes an error

2010-08-03 Thread wprater
Here is my model and an attempt to convert to json. Whether there is data returned or not, a circular reference error is thrown. How can I avoid this? ruby-1.8.7-p249 PayPeriod = PayPeriod(id: integer, start_date: date, end_date: date, pay_date: date) ruby-1.8.7-p249

[Rails] Adding data as a transaction

2010-08-03 Thread pipplo
Hey Everyone I'm new to RoR and this group so please let me know if I'm not being descriptive enough, or if I'm asking questions when I should RTFM. I have a basic understanding of RoR, but I'm kinda missing the next step for a web application I have in mind. I want to create an order form,

[Rails] :url being ignored or routing problem?

2010-08-03 Thread suzuki
background i have a page with a drop-down menu item. if any of the choices is selected, a partial gets activated to appear with new drop-down menu choices. the initial page uses a select_tag, observe_field, and a div to implement the above desired functionality. the pages i am working with

[Rails] JOBS: Experienced Rails Developer

2010-08-03 Thread redbasin32
Over the last two years, Bonanzle has been amongst the fastest growing marketplaces in all of ecommerce. Since launching in late 2008, we have grown to nearly 2 million monthly visitors and more than 3 million items posted for sale. We are looking to continue our aggressive growth by adding all

Re: [Rails] Rails3-beta4: Calling to_json on an ActiveRecord::Relation causes an error

2010-08-03 Thread Conrad Taylor
On Mon, Aug 2, 2010 at 2:26 PM, wprater mc.willpra...@gmail.com wrote: Here is my model and an attempt to convert to json. Whether there is data returned or not, a circular reference error is thrown. How can I avoid this? wprater, I would recommend trying Rails 3 RC by doing the following:

[Rails] Re: The Future OF RUBY and RUBY ON RAILS

2010-08-03 Thread Phoenix Rising
Dave gets +1 awesome on the missing the java boat point. Same deal here. Ruby is a great language. Rails is a great framework. There's no rule that says that this technology CAN'T go away, but the trend with Ruby/Rails has been explosive growth for the last five years or so. I've personally

Re: [Rails] Complex associations

2010-08-03 Thread Angel Robert Marquez
class Store ActiveRecord::Base has_many: store_type has_many: product_type, :through = department class Department ActiveRecord::Base belongs_to: store belongs_to: product class Product ActiveRecord::Base has_many :departments has_many :stores, :through = department end I think you need

Re: [Rails] Generating .mo with Rails 2.1.0

2010-08-03 Thread Bráulio B O Bhavamitra
Already fixed... just removed the unecessary option -rgettext/rails from command line 2010/8/2 Bráulio Bhavamitra brauli...@gmail.com Hello all, I'm a newbie to Ruby/Rails world, and also to the application I'm trying to use: Noosfero. The thing is, i'm trying to run 'rake makemo' with no

[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

[Rails] Re: how to configure rails to use mysql by default (not sqlite3)

2010-08-03 Thread Kenneth    
just add -d mysql option when you create a new rails project -- 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

[Rails] Re: :url being ignored or routing problem?

2010-08-03 Thread Frederick Cheung
On Aug 2, 11:15 pm, suzuki elle.on.ra...@gmail.com wrote: troubleshooting i'm looking at the log, and it seems to me that when i am at the initial page (and surrounding pages), i am in the desired controller. routing appears to be working as expected.  however, when i test my drop-down

[Rails] Re: Rails3-beta4: Calling to_json on an ActiveRecord::Relation causes an error

2010-08-03 Thread Huet
Hi All, I have had this problem with Rails 3 and 1.9.1. The fix for this error is to add to_a to the json call. render :json = {:top = @top.to_a.as_json(:only = [:id, :title ] ) } Hope this helps. Huet On Aug 3, 8:01 am, Conrad Taylor conra...@gmail.com wrote: On Mon, Aug 2, 2010 at 2:26

[Rails] Re: File creation in Rails

2010-08-03 Thread tonypm
To access files in rails, you can use the Ruby File Class http://ruby-doc.org/core/classes/File.html#M002579 You can put this into a method in the model. Then either call it specifically from the controller, or use an after_update callback to automatically create the file after the object has

[Rails] Drop down box in ruby

2010-08-03 Thread Chad Weier
Hello I've only been playing with ruby and rails for a few short weeks, I have an class called time in my libs folder and I want to call an array from this class and populate a drop down box/select box in rails in one of my view pages. everything online is so confusing regarding this.. Just say

[Rails] Re: Drop down box in ruby

2010-08-03 Thread Chad Weier
How would I get a select box to list -minute -hour -- 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

Re: [Rails] Re: Drop down box in ruby

2010-08-03 Thread lucas franceschi
i didn't understand that... try to explain me some things... i would be pleased to help. so, you want a ComboBox that shows what? the values in the array? if it is so, you may want to populate this array in the controller, and iterate it in the view, adding values for each item in your array.

[Rails] ActiveRecord - find MySQL connection/thread ID for query

2010-08-03 Thread Michaël
Hi, Is it possible, when using a find method with a Model, to record the MySQL thread ID for the subsequent database query? Does ActiveRecord expose this? Many thanks, Michaël -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to

[Rails] Re: ActiveRecord - find MySQL connection/thread ID for query

2010-08-03 Thread Marnen Laibow-Koser
Michaël wrote: Hi, Is it possible, when using a find method with a Model, to record the MySQL thread ID for the subsequent database query? Does ActiveRecord expose this? Why on earth would you need this? What are you trying to achieve? Many thanks, Micha�l Best, --  Marnen

Re: [Rails] Adding data as a transaction

2010-08-03 Thread Colin Law
On 2 August 2010 22:48, pipplo joe.kos...@gmail.com wrote: Hey Everyone I'm new to RoR and this group so please let me know if I'm not being descriptive enough, or if I'm asking questions when I should RTFM. I have a basic understanding of RoR, but I'm kinda missing the next step for a web

[Rails] Re: [ANN] NullDB 0.0.1

2010-08-03 Thread Marnen Laibow-Koser
Avdi Grimm wrote: == What NullDB is a Rails database connection adapter that interprets common database operations as no-ops. It is the Null Object pattern as applied to database adapters. [...] == Why NullDB is intended to assist in writing fast database-independant unit tests for

[Rails] Re: ActiveRecord - find MySQL connection/thread ID for query

2010-08-03 Thread Michaël
On Aug 3, 1:24 pm, Marnen Laibow-Koser li...@ruby-forum.com wrote: Michaël wrote: Hi, Is it possible, when using a find method with a Model, to record the MySQL thread ID for the subsequent database query? Does ActiveRecord expose this? Why on earth would you need this?  What are you

[Rails] Returning last value

2010-08-03 Thread Bla ...
Hi. I have the following controller of the update action: [code] def update @projeto = Projeto.find(params[:id]) if (@projeto.update_attributes(params[:projeto])) ## Mesmo raciocínio utilizado no create. @permissaoA = Permissao.find(:first, :conditions = [usuario_id = ?,

[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] Re: Languages

2010-08-03 Thread Robert Walker
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 and Navigation title. I've made alternate columns in my database

[Rails] Re: Juggernaut Rails 3

2010-08-03 Thread Rémi Gagnon
Same thing for me, I plan to put online a site with juggernaut this fall, an I keep wondering if its the right gem for a chatting engine. Is there any other gem or libs more up to date? Rémi Kenneth     wrote: Are there any plans to update the Juggernaut gem to be compatible with Rails 3?

[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 and Navigation title. I've made alternate

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

2010-08-03 Thread Rasmus Nielsen
Fabio Kreusch wrote: I am still stuck with this. Does anyone knows if this is the expected beavior for Rails? Should respond_with on update really return an empty json object? I pretty sure the Rails behavior is as intended. Rails basically says the save was successful by returning a 200

Re: [Rails] Re: Languages

2010-08-03 Thread Leonardo Mateo
On Tue, Aug 3, 2010 at 11:06 AM, Pale Horse li...@ruby-forum.com wrote: 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

[Rails] Re: Complex associations

2010-08-03 Thread Trish
Thank you for your response. However, I am refactoring an existing application, and am trying to remove a bunch of pure SQL that was put in the code. I believe the best way to do this is with a table association. One of the big features I want to use out of this is retrieving the records in the

[Rails] Re: Drop down box in ruby

2010-08-03 Thread Bob Proulx
Chad Weier wrote: I have an class called time in my libs folder and I want to call an array from this class and populate a drop down box/select box in rails in one of my view pages. everything online is so confusing regarding this.. There are multiple ways of invoking the helpers to produce

[Rails] Re: ActiveRecord - find MySQL connection/thread ID for query

2010-08-03 Thread Marnen Laibow-Koser
Michaël wrote: On Aug 3, 1:24�pm, Marnen Laibow-Koser li...@ruby-forum.com wrote: Many thanks, Micha l [Please quote what you're replying to. It will make the discussion easier to follow.] Because the application I'm maintaining uses Model find() methods to run large queries on the

[Rails] Re: Re: Languages

2010-08-03 Thread Marnen Laibow-Koser
Leonardo Mateo wrote: On Tue, Aug 3, 2010 at 11:06 AM, Pale Horse li...@ruby-forum.com wrote: I've not read this, though I imagine it to be overkill for my purposes. Really? You should read it. That's how rails works with i18n. Overkill would be to implement a different solution when a

[Rails] Re: ActiveRecord - find MySQL connection/thread ID for query

2010-08-03 Thread Michaël
It would be really useful if, when one of these large finds is run, that I could record the thread ID it creates so if I need to kill a thread, I can match it back up to the originating find() call. If the database kills a thread, can't you just rescue the appropriate exception?

[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 specifically

[Rails] How to CSS

2010-08-03 Thread Fernando Perez
Hi, It's not specifically related to Rails, but how do you arrange your CSS files? I used to dump everything in a gigantic screen.css file. Then I noticed that some rules only appeared in a few pages. Therefore I am considering having a layout.css for all pages and roughly 1 css file per

[Rails] Re: Re: Languages

2010-08-03 Thread Marnen Laibow-Koser
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 translation solutions. They're simply modules for managing the translated

[Rails] Re: simple redirect_to shows in log but doesn't redirect

2010-08-03 Thread joshmc...@gmail.com
Have you tried naming the file create.js.rjs? On Aug 2, 11:46 am, Neil Bye li...@ruby-forum.com wrote: Joshua Mckinney wrote: From inside your create method in the controller, what does request.format return? If the request is a plain old html request is should put text/html If the

[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 translation solutions. They're simply

[Rails] Re: How to CSS

2010-08-03 Thread Marnen Laibow-Koser
Fernando Perez wrote: Hi, It's not specifically related to Rails, but how do you arrange your CSS files? I used to dump everything in a gigantic screen.css file. Then I noticed that some rules only appeared in a few pages. Therefore I am considering having a layout.css for all pages

[Rails] Re: Re: Languages

2010-08-03 Thread Marnen Laibow-Koser
Pale Horse wrote: 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 translation solutions.

Re: [Rails] Re: Complex associations

2010-08-03 Thread Angel Robert Marquez
Thank you for your response. However, I am refactoring an existing application, and am trying to remove a bunch of pure SQL that was put in the code. I believe the best way to do this is with a table association. Why do you believe this? One of the big features I want to use out of

[Rails] Re: how to configure rails to use mysql by default (not sqlite3)

2010-08-03 Thread Marnen Laibow-Koser
Olivier Db wrote: Hello, I am running Mac OS X 10.6.4 and have installed the following: ruby-1.9.1-p429 (64 bits, I believe!) RubyGems 1.3.7 Rails 2.3.8 MySQL 5.1.49 (64 bits) I am now getting an error because sqlite3 is not installed SQLite comes with Mac OS. The OS uses it

[Rails] Re: Complex associations

2010-08-03 Thread Trish
See below... Thanks! Trish On Aug 3, 11:00 am, Angel Robert Marquez angel.marq...@gmail.com wrote: Thank you for your response.  However, I am refactoring an existing application, and am trying to remove a bunch of pure SQL that was put in the code.  I believe the best way to do this is

[Rails] Re: How to CSS

2010-08-03 Thread Fernando Perez
How do you organize that? The latter way. Ok. I also *highly* recommend using Sass: CSS alone is not powerful enough to fully separate content from presentation in a maintainable way -- Sass' higher-level abstractions are necessary here. I find sass ugly, and I reviewed less, but in

[Rails] Re: simple redirect_to shows in log but doesn't redirect

2010-08-03 Thread Neil Bye
Joshua Mckinney wrote: Have you tried naming the file create.js.rjs? Good idea but no difference. The latest configuration of the create function is: def create @story = Story.find(params[:story_id]) @story.comments.create params[:comment] request.format = :js end Gives a page

Re: [Rails] Re: How to CSS

2010-08-03 Thread Bob Nadler
On Tue, Aug 3, 2010 at 12:42 PM, Fernando Perez li...@ruby-forum.com wrote: How do you organize that? The latter way. Ok. Also, take a look at http://www.alistapart.com/articles/progressiveenhancementwithcss. The article recommends ways for splitting up your CSS. I also *highly* recommend

[Rails] Re: How to CSS

2010-08-03 Thread Marnen Laibow-Koser
Fernando Perez wrote: How do you organize that? The latter way. Ok. I also *highly* recommend using Sass: CSS alone is not powerful enough to fully separate content from presentation in a maintainable way -- Sass' higher-level abstractions are necessary here. I find sass ugly,

[Rails] rails 2.3.8 and html_safe

2010-08-03 Thread Andrew Kaspick
Hi, Can somebody update me on the state of html_safe strings in rails 2.3.8? I know rails 2.3.6 and 2.3.7 broke a lot of code because strings were being escaped when they shouldn't have been and I thought this was all fixed in 2.3.8. I'm upgrading an app from 2.3.5 to 2.3.8 and there are many

[Rails] Re: simple redirect_to shows in log but doesn't redirect

2010-08-03 Thread Neil Bye
Latest development. I've changed the ajax call stories/show.html.erb to div id='aremark' %= render :partial = 'comment' % /div h5label for=loginMake a comment:/label/h5 % remote_form_for :comment, :update ='aremark', :url=story_comments_path(@story) do |form| % div id=body%=

[Rails] Re: [ANN] NullDB 0.0.1

2010-08-03 Thread Eric Schmitt
Marnen Laibow-Koser wrote: Avdi Grimm wrote: == What NullDB is a Rails database connection adapter that interprets common database operations as no-ops. It is the Null Object pattern as applied to database adapters. [...] == Why NullDB is intended to assist in writing fast

[Rails] PDFKit Fork() Function Unimplemented Error - HELP!

2010-08-03 Thread Dylan Mccarthy
Hello All, We're working on a project on a Windows machine that will use PDFKit to convert an HTML page to a PDF. I have followed all the instructions at GitHub (http://github.com/jdpace/PDFKit), for installing wkhtmltopdf and PDFKit, then creating the config file in

[Rails] rendering multiline Javascript by using JSONP in rails

2010-08-03 Thread Lucas
Hello everybody, In a controller I try to render a javascript google ad to print it into some HTML using JSONP, like this script type=text/javascript!-- google_ad_client = pub-23222424; google_alternate_color = FF; google_ad_width = 468; google_ad_height = 60; //--/script script

[Rails] Re: [ANN] NullDB 0.0.1

2010-08-03 Thread Eric Schmitt
I'm fairly new to unit testing and TDD, but I think I understand the concept of what they're talking about here. The point is that if you are writing to the database during unit tests, you're actually testing the database adapter and abstraction layer, in this case: ActiveRecord, and not

[Rails] Re: [ANN] NullDB 0.0.1

2010-08-03 Thread Marnen Laibow-Koser
Eric Schmitt wrote: Marnen, I'm fairly new to unit testing and TDD, I've been doing test-first development as long as I've been doing Rails development, nearly 3 years. (Whether that means that I too am new to unit testing is left as an exercise for the student.) ? but I think I

[Rails] Re: rendering multiline Javascript by using JSONP in rails

2010-08-03 Thread Marnen Laibow-Koser
Lucas wrote: Hello everybody, In a controller I try to render a javascript google ad to print it into some HTML using JSONP, like this script type=text/javascript!-- google_ad_client = pub-23222424; google_alternate_color = FF; google_ad_width = 468; google_ad_height = 60;

[Rails] Prevent Helper Automatically Escaping String

2010-08-03 Thread Michael Satterwhite
I'm writing a helper to generate the display of a product and its information as retrieved from the database. Several HTML tags are part of this. As I'm building the string I want included in the HTML, Rails is automatically escaping the string - which prevents me from actually using the string I

[Rails] Restfull routes, link_to, and additional paramters

2010-08-03 Thread Jonathan Steel
I am trying to do a link_to with multiple to create an object. Everything works until ad the second parameter in. As soon as I add the second parameter, it forgets to add any information about the first one. link_to create, foos_path(@foo, :bar_id = @bar.id), :method = :post What am I doing

Re: [Rails] Prevent Helper Automatically Escaping String

2010-08-03 Thread Philip Hallstrom
I'm writing a helper to generate the display of a product and its information as retrieved from the database. Several HTML tags are part of this. As I'm building the string I want included in the HTML, Rails is automatically escaping the string - which prevents me from actually using the

[Rails] Re: [ANN] NullDB 0.0.1

2010-08-03 Thread Eric Schmitt
Marnen, You make some interesting points... I think I still have a ton to learn about unit testing and TDD best practices. I'm still just getting started. Thanks for the info! Warmest Regards, Eric -- Posted via http://www.ruby-forum.com/. -- You received this message because you are

[Rails] Re: rails 2.3.8 and html_safe

2010-08-03 Thread Owain
I just hit a similar problem where I was concatenating strings with escapable characters within a formbuilder. I googled about and there seems to be a some logic being discussed that anything that is magic security is going to be a nightmare. My problems were quite isolated (the great thing

[Rails] Re: Prevent Helper Automatically Escaping String

2010-08-03 Thread Michael Satterwhite
Philip Hallstrom wrote: def my_helper h2my unsafe string/h2.html_safe! end See http://weblog.rubyonrails.org/2009/10/12/what-s-new-in-edge-rails I'm not running edge rails, I'm running Rails 2.3.8. There is no html_safe! method defined, so this won't work. -- Posted via

[Rails] Re: simple redirect_to shows in log but doesn't redirect

2010-08-03 Thread joshmc...@gmail.com
The 2 most direct causes I can think of that would produce that error would be: 1. create.js.rjs is not in the correct director (.../app/views/ comments/create.js.rjs 2. create.js.rjs does not exist or bad file name Try using: def create @story = Story.find(params[:story_id])

Re: [Rails] Re: Prevent Helper Automatically Escaping String

2010-08-03 Thread Philip Hallstrom
def my_helper h2my unsafe string/h2.html_safe! end See http://weblog.rubyonrails.org/2009/10/12/what-s-new-in-edge-rails I'm not running edge rails, I'm running Rails 2.3.8. There is no html_safe! method defined, so this won't work. Ah. Then look at

[Rails] Re: Prevent Helper Automatically Escaping String

2010-08-03 Thread Robert Walker
Michael Satterwhite wrote: Philip Hallstrom wrote: def my_helper h2my unsafe string/h2.html_safe! end See http://weblog.rubyonrails.org/2009/10/12/what-s-new-in-edge-rails Or you can use the raw method in the view I think: %= raw my_helper % Sort of like the opposite of the old h

[Rails] Re: rendering multiline Javascript by using JSONP in rails

2010-08-03 Thread Lucas
No.  The problem is that your double-quoted string contains double quotes! It contains double-quotes but they are escaped aren't they ? There are quoting constructs that would do the trick.  But you have a bigger problem: you really shouldn't be doing this in the controller. Rendered JS,

[Rails] Re: Re: Prevent Helper Automatically Escaping String

2010-08-03 Thread Michael Satterwhite
Philip Hallstrom wrote: Ah. Then look at activesupport/lib/active_support/core_ext/string/output_safety.rb OK, I'm looking at it. I must be dense, though - or I've got a BAD case of tunnel vision. How do I STOP these from changing the string? I'm sure it's obvious ... but I'm not seeing

[Rails] Re: [ANN] NullDB 0.0.1

2010-08-03 Thread Avdi Grimm
1. Why are we suddenly discussing a two year old post here? Clue me in. 2. Myron Marsten is now the maintainer of NullDB. See http://github.com/nulldb/nulldb 3. I'm not really interested in rehashing the arguments for NullDB. Enough teams are happily using it that I had to transfer

[Rails] Re: rails 2.3.8 and html_safe

2010-08-03 Thread Robert Walker
Andrew Kaspick wrote: I'm upgrading an app from 2.3.5 to 2.3.8 and there are many spots where previous code was output correctly and now it expects html_safe method calls to properly escape the strings. Are those who don't want to use the new escaping behaviour in the 2.3.x branch expected to

[Rails] Re: Prevent Helper Automatically Escaping String

2010-08-03 Thread Michael Satterwhite
Robert Walker wrote: Michael Satterwhite wrote: Philip Hallstrom wrote: def my_helper h2my unsafe string/h2.html_safe! end See http://weblog.rubyonrails.org/2009/10/12/what-s-new-in-edge-rails Or you can use the raw method in the view I think: THANK YOU! THANK YOU! THANK YOU! This

[Rails] Re: Re: Prevent Helper Automatically Escaping String

2010-08-03 Thread Robert Walker
Michael Satterwhite wrote: Philip Hallstrom wrote: Ah. Then look at activesupport/lib/active_support/core_ext/string/output_safety.rb OK, I'm looking at it. I must be dense, though - or I've got a BAD case of tunnel vision. How do I STOP these from changing the string? I'm sure it's

[Rails] Re: rails 2.3.8 and html_safe

2010-08-03 Thread Andrew Kaspick
Robert Walker wrote: Andrew Kaspick wrote: I'm upgrading an app from 2.3.5 to 2.3.8 and there are many spots where previous code was output correctly and now it expects html_safe method calls to properly escape the strings. Are those who don't want to use the new escaping behaviour in the

[Rails] Re: segmentation fault from mysql_adapter.rb

2010-08-03 Thread Patrick Aron
Divya Mohan wrote: Not yet solved. :( I had a simular problem (i am also newbie) for me it was solved by adding host: localhost in the config/database.yml file Hope it can help some others to.. grtz, patrick -- Posted via http://www.ruby-forum.com/. -- You received this message because

[Rails] Strange error message when rendering the scaffold form

2010-08-03 Thread rodrigo3n
Hello everyone, I am developing my application and I created a scaffold called listas, but when I acess /listas/new I get this error message: NoMethodError in Listas#new Showing /home/rodrigo3n/code/listeiroo/app/views/listas/_form.html.erb where line #15 raised: undefined method

[Rails] Re: Re: Prevent Helper Automatically Escaping String

2010-08-03 Thread Robert Walker
Robert Walker wrote: some_string = scriptalert(Gotcha!)/script Ignore my still syntax error above with the nested double quotes. Single quote the string in the JS part or fix however you like. %= h some_string % or %= html_escape some_string % = scriptalert(Gotcha!)/script %= some_string

[Rails] Re: [ANN] NullDB 0.0.1

2010-08-03 Thread Marnen Laibow-Koser
Avdi Grimm wrote: 1. Why are we suddenly discussing a two year old post here? Clue me in. My apologies! It appeared at the top of my list feed and I neglected to check the date. I'm not sure why it appeared at the top of my feed. [...] But briefly, I'll say this: if you are including the

[Rails] Re: rails 2.3.8 and html_safe

2010-08-03 Thread Robert Walker
Andrew Kaspick wrote: Exactly. I'm not using the rails_xss plugin, but the escaping rules are not as they were in 2.3.5. String literals were safe in 2.3.5, but aren't in 2.3.8... a minor difference with huge implications. I created a quick-n-dirty test app. See the result here:

[Rails] Re: rendering multiline Javascript by using JSONP in rails

2010-08-03 Thread Marnen Laibow-Koser
Lucas wrote: No. �The problem is that your double-quoted string contains double quotes! It contains double-quotes but they are escaped aren't they ? Whoops! You're right. I somehow overlooked the backslashes. There are quoting constructs that would do the trick. �But you have a bigger

[Rails] Re: SystemExit: exit

2010-08-03 Thread Robert Walker
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 paste more code, has anyone come across this before? Maybe you need to paste more code. Only

[Rails] Re: rails 2.3.8 and html_safe

2010-08-03 Thread Andrew Kaspick
Robert Walker wrote: Andrew Kaspick wrote: Exactly. I'm not using the rails_xss plugin, but the escaping rules are not as they were in 2.3.5. String literals were safe in 2.3.5, but aren't in 2.3.8... a minor difference with huge implications. I created a quick-n-dirty test app. See the

[Rails] Re: [ANN] NullDB 0.0.1

2010-08-03 Thread Avdi Grimm
Marnen Laibow-Koser wrote: And there's an argument to be made that since the AR framework is part of an AR class, it must be respected -- and hit *some* state-preserving DB-like thing -- to properly unit test an AR class. This is the kind of muddling of concepts that I think Rails

[Rails] Re: InvalidToken for a Flash upload

2010-08-03 Thread Lily ^_^
Lily ^_^ wrote: Hi, I am developping a small Flash app to upload multiple files with a progress bar in a Rails site. Rails handles the server side. I have a controller that displays the view containing the flash, and it also provides a security token to the flash. The Flash gets it and

[Rails] Re: [ANN] NullDB 0.0.1

2010-08-03 Thread Marnen Laibow-Koser
Avdi Grimm wrote: Marnen Laibow-Koser wrote: And there's an argument to be made that since the AR framework is part of an AR class, it must be respected -- and hit *some* state-preserving DB-like thing -- to properly unit test an AR class. This is the kind of muddling of concepts that I

[Rails] Re: Strange error message when rendering the scaffold form

2010-08-03 Thread Jeff
On Aug 3, 2:14 pm, rodrigo3n rodrig...@gmail.com wrote: Hello everyone, I am developing my application and I created a scaffold called listas, but when I acess /listas/new I get this error message: NoMethodError in Listas#new Showing

Re: [Rails] Returning last value

2010-08-03 Thread clanlaw
On 3 August 2010 14:17, Bla ... li...@ruby-forum.com wrote: Hi. I have the following controller of the update action: [code] def update   �...@projeto = Projeto.find(params[:id])    if (@projeto.update_attributes(params[:projeto]))    ## Mesmo raciocínio utilizado no create.  

[Rails] Re: rails 2.3.8 and html_safe

2010-08-03 Thread Andrew Kaspick
Andrew Kaspick wrote: Robert Walker wrote: Andrew Kaspick wrote: Exactly. I'm not using the rails_xss plugin, but the escaping rules are not as they were in 2.3.5. String literals were safe in 2.3.5, but aren't in 2.3.8... a minor difference with huge implications. I created a

[Rails] Re: simple redirect_to shows in log but doesn't redirect

2010-08-03 Thread Neil Bye
Joshua Mckinney wrote: Try using: def create @story = Story.find(params[:story_id]) @story.comments.create params[:comment] request.format = :js respond_to do |format| format.js end end Although respond _to blocks are not always necessary, it can't hurt to

[Rails] rails 3 download - where ?

2010-08-03 Thread Dani Dani
I'm trying to update my rails from 2.3.8 to 3.0, where can I get the kit from ? Thanks, Dani -- 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] rails 3 download - where ?

2010-08-03 Thread Fidel Viegas
gem install rails --pre this will install rails 3.0 rc1 All the best, Fidel. On 8/3/10, Dani Dani li...@ruby-forum.com wrote: I'm trying to update my rails from 2.3.8 to 3.0, where can I get the kit from ? Thanks, Dani -- Posted via http://www.ruby-forum.com/. -- You received this

Re: [Rails] rails 3 download - where ?

2010-08-03 Thread jason white
Ryan Bates from railscasts.com has an excellent screencast on this subject. The links you are looking for are on the page under resources. http://railscasts.com/episodes/225-upgrading-to-rails-3-part-1 On Tue, Aug 3, 2010 at 4:04 PM, Dani Dani li...@ruby-forum.com wrote: I'm trying to

[Rails] Rails3 + rcov

2010-08-03 Thread Greg Donald
I hit a wall today with rcov + Rails3. I am developing my Rails3 app using Ruby 1.9.2-preview3. rcov and relevance-rcov do not work with Ruby 1.9.2 yet. I can't find any fork of rcov that does yet either. It wasn't that big of a deal since I could easily switch over to Ruby 1.8.7 using rvm

[Rails] Re: Restfull routes, link_to, and additional paramters

2010-08-03 Thread Bob Proulx
Jonathan Steel wrote: I am trying to do a link_to with multiple to create an object. Everything works until ad the second parameter in. As soon as I add the second parameter, it forgets to add any information about the first one. What do you mean, it forgets to add any information about the

[Rails] Re: rails 2.3.8 and html_safe

2010-08-03 Thread Robert Walker
Andrew Kaspick wrote: I just wanted to know if others are having this issue, and it sounds like people are, but I'm still not sure if this is a bug or if this is the expected behviour for 2.3.8. If this is expected behaviour for 2.3.8 then this should not have been in a minor point release

[Rails] Rails 2.3.8 and form_tag usage

2010-08-03 Thread crashbangboom
I have just upgraded my entire system to use the subject line version of rails...of course...this broke my previous rails apps as many things are handled a bit differently...! I have all apps running fine now but am having a problem when using form_tag over form_for...(I need form_tag so I can

[Rails] Re: rails 3 download - where ?

2010-08-03 Thread Dani Dani
Fidel Viegas wrote: gem install rails --pre this will install rails 3.0 rc1 All the best, Fidel. thank you. this has helped upgrading, problem is I got the following error: ERROR: While executing gem ... (Errno::EINVAL) Invalid argument - .//cdesc-.yaml Any idee what this means

Re: [Rails] Re: rails 3 download - where ?

2010-08-03 Thread Fidel Viegas
If you want to upgrade from previous versions, I suggest you look into http://www.railsupgradehandbook.com/ I haven't really played with Rails 3 that serious. I am still using 2.3.8, and will only jump to rails 3 when it is production ready. But I have been playing with it from time to time and

Re: [Rails] Re: Strange error message when rendering the scaffold form

2010-08-03 Thread Cesar Sanz
Stop your server and run it again -original message- Subject: [Rails] Re: Strange error message when rendering the scaffold form From: Jeff cohen.j...@gmail.com Date: 08/03/2010 14:10 On Aug 3, 2:14 pm, rodrigo3n rodrig...@gmail.com wrote: Hello everyone, I am developing my application and I

[Rails] parent controller_name (nested)

2010-08-03 Thread Rodrigo Mendonça
Hi people, i have this route in rails http://localhost:3002/gdm/9/cd/posts/10/comments we can see we have a namespace with prefix in gdm/9/cd/ also we have two controllers i will create a helper, and need get ther controllers name with commands i know i can get comments with

  1   2   >