similar to: redirect with multi-dimensional parameter hashes

Displaying 20 results from an estimated 1000 matches similar to: "redirect with multi-dimensional parameter hashes"

2008 Oct 10
2
Add hash to serialized column
Hey guys, I''m trying to merge a hash with another using the .merge! function. class User < ActiveRecord::Base serialize :preferences end This is what I end up with in the console: >> u = User.find(1) >> u.preferences.merge!{:test => 1} SyntaxError: compile error (irb):32: syntax error, unexpected tASSOC, expecting ''}'' u.preferences.merge!{:test
2010 Apr 05
3
syntax error, unexpected '\n', expecting tASSOC
Hey all, I get the following error. Now I know it''s related to a curly brace, but it seems that all curly braces are properly in place. So I''m not sure why I get this error: SyntaxError in DashboardController#panels rails/app/controllers/dashboard_controller.rb:170: syntax error, unexpected ''\n'', expecting tASSOC def panels addDetailToContainer =
2007 May 28
2
helper with block compile error
HI, i''m trying to write a helper that replaces link_to_remote that accepts a block but it gets a compile error in the template: I don''t know what I''m doing wrong... TIA # application_helper.rb def link_block_to_remote( options = {}, html_options = {}, &block) concat(link_to_remote(capture(&block), options, html_options), block.binding) end # in
2007 Dec 07
2
[ActiveSupport] Patches needing review: re-organization of #to_query methods, preservation of XML/JSON content-type
Just a quick pointer to some ActiveSupport patches hoping for reviews: Puts Array#to_query and Object#to_query in the right places in ActiveSupport - http://dev.rubyonrails.org/ticket/10395 Preserve user-specified content type for XML and JSON rendering (currently it''s overridden and set to Mime::XML/Mimi::JSON - http://dev.rubyonrails.org/ticket/10388 Oh and a tiny patch for
2006 Jan 19
9
start_form_tag not taking url_for options
I''ve got a form that should post to user/login. The code to start the tag is: <%= start_form_tag { :controller => "user", :action => "login" } %> That gives me this exception: compile error script/../config/../app/views/user/login.rhtml:1: parse error, unexpected tASSOC, expecting ''}'' _erbout = ''''; _erbout.concat((
2006 Aug 04
1
route error with controllers in a module, should just work
This is ALL I have added to my routes.rb map.connect ''admin'', :controller => ''/admin/welcome'' I have found plenty of examples saying this is correct if you have a WelcomeController in the Admin module, which I do :) But now webrick won''t even start ??? Look at those 4 colons ::::, what is that about ? help ! => Booting WEBrick...
2010 Feb 18
5
Converting hash to option string
Is there a good way to programmatically convert {:a=>''b'', :c=>''d''} to ''a=b c=d'' ? Rails seems to do this knid of thing "all over the place". I see reverse_merge and similar functions ... but I wonder if this is canned behavior somewhere. -- Posted via http://www.ruby-forum.com/. -- You received this message because you
2010 Nov 27
2
Long elaboration
Well.... my problem is that after form post, I have to do a long elaboration. So, my page remain stuck for a long time.... I would like to display an intermediate page after post (thank for your collaboration..blah, blah, blah.....) so that the visitor knows whats going on. Any suggestion? Thanks in advance... -- Posted via http://www.ruby-forum.com/. -- You received this message because you
2012 Sep 01
4
Basic Paypal
Hi all i am following this like for basic paypal http://railscasts.com/episodes/141-paypal-basics and i got this error View: <%= link_to "Checkout", @cart.paypal_url() %> undefined method `paypal_url'' for nil:NilClass despite i have this code in my model called Card Cart Model: class Cart < ActiveRecord::Base def paypal_url(return_url) values = {
2008 Aug 24
11
link_to_function check javascript attribute
How could I check the value of an javascript object''s attribute? <div id="new_item_details" style="display:none"></div> <%= link_to_function("Show details...", nil, :id => "show_details") do |page| page.visual_effect(:toggle_blind, :new_item_details) if (page[:new_item_details].style.visibility ==
2007 Nov 19
3
link_to and GET parameters
Hi, I am trying to generate a link to external site with GET parameters ( in new window). I tried following code, but it does not produce any parameters. <%=link_to "Open New Page", "https://www.foo.com/page/", {:popup => true}, {:param1 => "value1", :param2 => "value2"}%> and <%=link_to "Open New Page",
2008 Oct 03
7
form_remote_tag and :with
I am trying to pass the result from a javascript function along with the result from a text_field with form_remote_tag. This is what I have so far, but no go: <% form_remote_tag(:url => {:controller => ''requests'', :action => ''create''}, :with => "''data=''+request()", :update => ''request_sent'' )
2009 Mar 10
5
'unknow column error' when using include and associated table condition in find
Here is my weird problem. Two models like following: Lexeme id:int name:string Structure id:int ref_id:string meta_id:int Lexeme can have many structure records through foreign key ''ref_id'' in the structures table. And these structure records belonging to one lexeme differs between each other using meta_id. And if Lexeme has structures, then there must be a top_struct whose
2008 May 07
2
Can I add a singleton action to @controller in a test?
All, I want to create a mock action to test a filter in a functional test, e.g.: # Simplified example def test_my_filter # Singleton action def @controller.foo assert # something end ActionController::Routing::Routes.draw do |map| map.connect '':controller/foo'', :action => ''foo'' end get :foo end My log files show that
2008 May 29
2
Render partial yields "dynamic constant assignment"
I''m getting a syntax error when rendering a partial. This is a simple html partial with one instance variable inside it. Rendering as a "template" instead of as a partial works just fine. The error occurs 3 lines after the last line of HTML code in the partial. There is no line 72! Here is the error: SyntaxError in Building_blocks#preview Showing
2008 May 07
2
Question on authenticity tokens
Does anyone find them useful? I can see them being good in some cases, but I have many exceptions that occur because of expired sessions. I am also not sure if they are really required for pages that require a login to access. The other place that they cause issues is in javascript requests. I am not using the built-in helpers, and all the javascript exists in separate js files. There is ways
2008 Jun 13
6
Newbie question on has_many
I have two classes: a Widget and a User. The User has an id that is referenced in two places on the Widget: owner_id and operator_id. How should I structure that reference for has_many? Thanks folks - I appreciate any help on this. --David --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails:
2009 Feb 02
2
ActiveRecord::AssociationTypeMismatch (User(#54754560) expected, got User(#54510280))
i keep getting this AssociationTypeMismatch error. i think this could be a bug related to ruby/rails when using mixins. heres a short version of my code: # user.rb require ''friend_invitation'' require ''friendship'' class User < ActiveRecord::Base include FriendInvitationUser, FriendshipUser ... end # friendship.rb ... module FriendshipUser def
2007 Jun 01
2
Decoder and discarded frames..., system hangs
Do i always need to tell the decoder that some packets has been lost? I noticed that if i discard packets without passing NULL and advising the decoder, sometimes my system hangs and i need to reset my PDA. Since the decoder is mantaining a state, i suppose i always need to tell it a packet has been discarded through a sequence number check. Or can i just pass to speex_decode_int whatever i
2008 Aug 24
3
tricky include question
I''ve been here before and maybe I''m trying to do something that is not possible. I am trying to include tables that are associated to other tables in the actual include statement but not to the original table call. In this case the furnii table. this is my original query @furnii_from_furnii = Furni.find :all, :include =>[:raider, {:imageasset => :skin}], :conditions =>