[Rails] Re: Forcing link_to 'put'

2010-04-17 Thread MarkB
Unfortunately that does not work. Same error, as if link_to is ignoring the :method argument and defaulting to get/show. On Apr 15, 4:22 am, Heinz Strunk li...@ruby-forum.com wrote: What happens if you remove :action = :update? Shouldn't be necessary cause put automatically calls the update

Re: [Rails] Re: FORM fields sent to the CONTROLLER

2010-04-17 Thread Colin Law
On 16 April 2010 23:11, David Zhu dzwestwindso...@gmail.com wrote: right i understand colin what you mean, but u must have mis understood my question- My question is after the user hits submit, how can i transfer the content for the fields in the form that he just filled out- into the

Re: [Rails] if your javascript doesn't execute, but instead just gets displayed on the browser...

2010-04-17 Thread Colin Law
On 17 April 2010 04:57, mstoth mich...@virtualpianist.com wrote: OK, I've been struggling for days trying to understand why my javascript is just being displayed on the browser rather than executed.  I have found out the placement of the javascript_include_tag was my problem. I have other

Re: [Rails] Re: Forcing link_to 'put'

2010-04-17 Thread Colin Law
On 17 April 2010 07:16, MarkB mark_ba...@hotmail.com wrote: Unfortunately that does not work.  Same error, as if link_to is ignoring the :method argument and defaulting to get/show. Have you checked the html generated by the link, and looked in the log to see if anything useful there? Colin

[Rails] Re: Re: Forcing link_to 'put'

2010-04-17 Thread Heinz Strunk
Colin Law wrote: Have you checked the html generated by the link, and looked in the log to see if anything useful there? Colin Yeah, what's the output of %= link_to 'Recalculate', item_cost_path(:recalc = 1), :method = :put %? -- Posted via http://www.ruby-forum.com/. -- You received

Re: [Rails] Re: Re: Forcing link_to 'put'

2010-04-17 Thread Colin Law
On 17 April 2010 09:29, Heinz Strunk li...@ruby-forum.com wrote: Colin Law wrote: Have you checked the html generated by the link, and looked in the log to see if anything useful there? Colin Yeah, what's the output of %= link_to 'Recalculate', item_cost_path(:recalc = 1), :method = :put

[Rails] Re: i wnat my application to run site 5 of ROR i am getting public_html and other folder but i want to get run my application what to do

2010-04-17 Thread mac
hello rahul create a ticket in backstage site5 will themself guide you to the process via mail thank you On Apr 7, 3:02 pm, Rahul Mehta rahul23134...@gmail.com wrote: I am getting problem in hosting... On Apr 7, 2:59 pm,RahulMehtarahul23134...@gmail.com wrote: i wnat my application to

[Rails] Re: validates_format_of with condition

2010-04-17 Thread Priyanka Pathak
Hi, Use allow_blank = true -- 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

[Rails] A very weird bug in ruby

2010-04-17 Thread Trausti Thor Johannsson
Yes yes, I think I have found my 2nd compiler bug (not counting realbasic). I think I found an actual bug in Ruby, on all platforms none the less (well linux and mac). if yu just run console or irb and do this ph = no.305.week b = ph+5 returns no.305.week5 then do b.delete ph and it returns

[Rails] datepicker inside a form ... how ?

2010-04-17 Thread Ale Ds
Hi, I am using jquery lib in a rails app. In a search form (created with form_tag) I have different fields and one datepicker object, of course I can get all values from any text field but how can I get the stringdate from datepicker when I push the search button ? Thank you, Alessandro --

[Rails] Re: A very weird bug in ruby

2010-04-17 Thread Frederick Cheung
On Apr 17, 10:27 am, Trausti Thor Johannsson traust...@gmail.com wrote: Yes yes, I think I have found my 2nd compiler bug (not counting realbasic).  I think I found an actual bug in Ruby, on all platforms none the less (well linux and mac). if yu just run console or irb and do this ph =

[Rails] About HTTP-only cookies in Ruby on rails.

2010-04-17 Thread Yuchen Zhou
Hi all, I am a security researcher at University of Virginia, I am currently doing research on HTTP-only cookie deployment. May I ask do ruby on rails support HTTP-only cookies, if yes, what is the default configuration for ruby on rails? In other words, do the HTTP servers need to set HTTP-only

Re: [Rails] Re: A very weird bug in ruby

2010-04-17 Thread Trausti Thor Johannsson
Ah ha. That makes delete actually quite cool function. Thank you. Trausti On Sat, Apr 17, 2010 at 12:48 PM, Frederick Cheung frederick.che...@gmail.com wrote: On Apr 17, 10:27 am, Trausti Thor Johannsson traust...@gmail.com wrote: Yes yes, I think I have found my 2nd compiler bug (not

Re: [Rails] Re: Re: Forcing link_to 'put'

2010-04-17 Thread Vladimir Rybas
btw, found not much time ago, that you need to do :conditions = {:method = :put} instead of just :method = :put in routes.rb when define a route ' On Sat, Apr 17, 2010 at 4:01 PM, Colin Law clan...@googlemail.com wrote: On 17 April 2010 09:29, Heinz Strunk li...@ruby-forum.com wrote: Colin

Re: [Rails] Re: controller request.body?

2010-04-17 Thread Vladimir Rybas
See request.methods to find what you want. Or just use debugger. def index debugger ... end $ rdebug script/server when it stops first time after run c[Enter] then go to your action with browser, and the server will stop on the 'debugger' method position. Then you just run irb[Enter]

[Rails] Re: About HTTP-only cookies in Ruby on rails.

2010-04-17 Thread Frederick Cheung
On Apr 17, 7:54 am, Yuchen Zhou pinkforpe...@gmail.com wrote: Hi all, I am a security researcher at University of Virginia, I am currently doing research on HTTP-only cookie deployment. May I ask do ruby on rails support HTTP-only cookies, if yes, what is the default configuration for ruby

Re: [Rails] Question: How do I mix Ruby and Javascript in application.js

2010-04-17 Thread Vladimir Rybas
Create application.js.erb and put it in views/js/ then you render :partial = 'js/application.js.erb', :locals = {:data = @your_data} and use variable 'data' in your partial like script var foo = %= data[:foo]% /script On Sat, Apr 17, 2010 at 2:13 AM, Jose joloh...@me.com wrote: How can I

Re: [Rails] Re: Where can i find video turorials of Ruby on Rails

2010-04-17 Thread Vladimir Rybas
rubytu.be On Fri, Apr 16, 2010 at 8:29 PM, Amala Singh amalasi...@gmail.com wrote: *Railscasts* - Free Ruby on Rails

[Rails] [Ajax and RJS] :bottom is null

2010-04-17 Thread Greg Ma
Hello, I ma following ryanb screencast about Ajax, and i am trying to add an element to my list using ajax and RJS. My problem is that my object is correctly inserted but the rendering isn't working because the bottom property is null... Here is the error: try { Element.insert(message_list, {

[Rails] Design - Best practices on managing many-to-many controllers?

2010-04-17 Thread Adriano Nagel
Hi, This may seem a silly question, but I didn't find an elegant solution to manage a user's tag collection. Perhaps I'm missing something, I'd like to know if there is a better way to handle it are. The configuration is pretty standard stuff: user.rb: has_many :user_tags, :dependent =

Re: [Rails] Re: controller request.body?

2010-04-17 Thread Chris Habgood
I can do request.inspect and see what comes in, but the text is not there it seems to be embedded somewhere. On Sat, Apr 17, 2010 at 06:38, Vladimir Rybas vladimirry...@gmail.comwrote: See request.methods to find what you want. Or just use debugger. def index debugger ... end $

[Rails] Re: newb's quick question on session variable vs. params in 'pretty' urls

2010-04-17 Thread Grary
Steve, I'm persisting a 'transitional' object through a few views, spawning descendants from it and then deleting the parent object. In this case, then, it doesn't seem to make sense to publicize a reference to the transitional object in a url because the referenced object will not be persisted

[Rails] Re: Allow '.' to be a part of identifier, not a separator of format

2010-04-17 Thread Jeff Lewis
In your ./config/routes.rb, you could do something like: ... map.connect '/movies/:title', :controller='movies', :action='by_title', :requirements={:title=/[-_+.a-z0-9]+/i} ... See Regular Expressions and Parameters on

Re: [Rails] Re: controller request.body?

2010-04-17 Thread Rick DeNatale
On Fri, Apr 16, 2010 at 9:16 PM, Me chabg...@gmail.com wrote: StringIO#request.body  says StringIO in the log file. On Apr 16, 7:40 pm, Rick DeNatale rick.denat...@gmail.com wrote: On Fri, Apr 16, 2010 at 8:34 PM, Me chabg...@gmail.com wrote: I am trying to get the body of the request coming

[Rails] Re: Design - Best practices on managing many-to-many controllers?

2010-04-17 Thread Adriano Nagel
I decided to create a restful controller for the tags, nested in the users resources, and not associated with any model: resources :users do resources :utags, :only = [:index, :create, :destroy] end I'm using these routes in the views: %= link_to 'destroy', user_utag_path(@user, tag),

[Rails] Update related model after_destroy object

2010-04-17 Thread Juan Kinunt
Hi!, I know that Rails do not save in cascade so I need to solve this problem: I have invoice that has lines. Invoice have fields that are calculated with values of lines so when a line is modified or deleted I need to update the invoice, how I do that automaticaly? If I use before_save on

[Rails] rails custom helpers

2010-04-17 Thread Me
I made a helper module and put it in the helper directory but when I try and access any methods it says it does not recognize them. Ideas? Rails 2.3.5 Helper: module XmlTestDataHelper def update_xml_data end end Controller: update_xml_data undefined local variable or method

Re: [Rails] rails custom helpers

2010-04-17 Thread Leonardo Mateo
On Sat, Apr 17, 2010 at 2:19 PM, Me chabg...@gmail.com wrote: I made a helper module and put it in the helper directory but when I try and access any methods it says it does not recognize them. Ideas? Rails 2.3.5 Helper: module XmlTestDataHelper  def update_xml_data   end end

[Rails] Re: validates_format_of with condition

2010-04-17 Thread pepe
validates_format_of :email, :with=/^[0-9a-za-z_][\w\.-]*[a-za-z0-...@[a-za-z0-9][\w\.-]*[a-za- Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/, :message = is not valid, :unless = Proc.new { |your_model_name_or_any_variable_name_you_want|

[Rails] Having trouble looping through an array of Regular Expressions in a Rake task

2010-04-17 Thread command0
Hey guys, I was wondering if someone could give me some insight on an issue I'm having. I am working on a Rails app that will be a data efficient, user friendly New King James Version of the Bible. What I am presently doing is making a Rake task to build all the chapters to all of the books. So

[Rails] Re: Update related model after_destroy object

2010-04-17 Thread command0
It sounds like the solution you are looking for is going to require parsing some JSON, and then handling the update through something like jQuery. I'm still trying to wrap my head around AJAX interacting with Rails in such a way. Before you'd just use RJS, and Prototype would handle the request,

[Rails] Re: rails custom helpers

2010-04-17 Thread Me
No, are not all of the helpers included all the time? I have 'helper :all' in the application controller. On Apr 17, 12:41 pm, Leonardo Mateo leonardoma...@gmail.com wrote: On Sat, Apr 17, 2010 at 2:19 PM, Me chabg...@gmail.com wrote: I made a helper module and put it in the helper directory

Re: [Rails] contet_tag :ul question

2010-04-17 Thread Rick DeNatale
On Fri, Apr 16, 2010 at 3:26 PM, Pito Salas li...@ruby-forum.com wrote: Hi all This isn't doing what I expect it to. Can you give it a quick look-see if you have a moment?  def user_navigation_helper    content_tag(:div, :class =banner_right) do      content_tag(:ul, :class = wat-cf) do  

[Rails] Re: content_tag :ul question

2010-04-17 Thread Pito Salas
Thanks both!! So the code snippet below now works correctly Is there a more typical way of doing what I am doing or would you consider this idiomatic rails? -- PIto def user_navigation_helper content_tag(:div, :class =banner_right) do content_tag(:ul, :class = wat-cf) do

[Rails] Re: FORM fields sent to the CONTROLLER

2010-04-17 Thread David Zhu
wait what am I doing wrong with my posting? On Apr 17, 3:58 am, Colin Law clan...@googlemail.com wrote: On 16 April 2010 23:11,DavidZhudzwestwindso...@gmail.com wrote: right i understand colin what you mean, but u must have mis understood my question- My question is after the user hits

[Rails] Re: rails custom helpers

2010-04-17 Thread Sheldon Finlay
helper: all just makes all the helpers available to your views, but not to controller or model classes. This is because helpers are really meant for views only. You can mix a helper in by including the helper, but it really isn't a good practice. Better to create a separate module or mixin and not

Re: [Rails] Re: rails custom helpers

2010-04-17 Thread Chris Habgood
okie dokie. On Sat, Apr 17, 2010 at 21:27, Sheldon Finlay jag...@gmail.com wrote: helper: all just makes all the helpers available to your views, but not to controller or model classes. This is because helpers are really meant for views only. You can mix a helper in by including the helper,

[Rails] help testing Rails patches / tickets

2010-04-17 Thread rails.n...@gmail.com
I'm new to this and trying to test this patch: https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/3645 Steps: git clone git://github.com/rails/rails.git git checkout v3.0.0.beta1 (I assume this is what the patch works on judging by the date?) git am ~/labels-with-blocks.diff

[Rails] Is there a way to use @today in a model ??

2010-04-17 Thread Bob Smith
I'm trying to get records from a has_many that are only from this year. has_many :visit, :conditions = year = #...@today.year}, :dependent = :destroy This has trouble. it thinks @today is null.. Any other ideas? Bob -- You received this message because you are subscribed to the Google Groups

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

2010-04-17 Thread Bob Smith
this line was the problem.. @household = Household.new(params[:household]) it was saving the people records because they were linked to household, so a later @household.update_attributes(params[:household]) doubled the record. Changing the line to @household = Household.new() fixed the