Displaying 20 results from an estimated 600 matches similar to: "Saving many_to_many"
2012 Jun 01
3
Serialized attribute saved as HashWithIndifferentAccess in database
My Booking model has: serialize :custom_data, Hash
From the console it works as expected saving values to the custom_data
attribute.
But when having a form with parameters like
this: booking[custom_data][hello] and creating a new object in the
controller like this: Booking.new( params[:booking] ), values are saved in
the database with added metadata like this: ---
2006 Jul 08
2
Creating/Saving dependent objects
Folks,
Am new to RoR and am building an example to get myself familiar. I am
running into a simple issue while creating a user registration page.
I have a User and Address models defined as below (partial/relevant code
included below). User has_one address and Address belongs_to user. I have a
foreign key defined in address table that refers to user(id)
In a form I take in username, password,
2005 Dec 03
1
typecasting HashWithIndifferentAccess
I want to typecast an object of HashWithIndifferentAccess (params) to Hash.
Whats the way of doing this (except each?)
Thanks in advance.
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails
2010 Aug 23
7
Sharing sessions between a rails3 app and a rails2 app. Rails 2 app crashes.
Hey all.
I have two apps. One is a rails3 app and the other is a rails 2 app.
Using proxying I am routing actions in the myapp.com/foo to the rails2
app.
It almost works! I can set a session variable and a cookie variable on
the first app (myapp.com) and then read them on the second app
(myapp.com/foo).
It only works the first time though. If I go back to myapp.com and
then revisit
2006 Feb 02
8
How to get all selected rows in the mutli-selection listbox?
Hi,
I have created a multiple selection listbox with
rails, when I try to get the rows selected by user,
rails send back only the first one, how can I get the
other selected rows????
I created the listbox with the following function:
select_tag("form__list1",
options_for_select(["A","B","C","D"], selected = "A"),
html_options =
2007 Oct 15
2
Something is wrong with Camping::H in the svn version
Dear All,
I got az error message with the svn version of Camping under FastCGI
NoMethodError undefined method `user_id'' for
{"user_id"=>2}:HashWithIndifferentAccess:
The call was a simple "User.find @state.user_id" in my login
controller... The following libraries are loaded manually:
action_controller, action_view, mime/types, camping, camping/mab,
2007 Jan 10
0
many_to_many relationship problem
Hello everyone, i wonder if someone can help i''m a newcomer and this
problem is driving me crazy.
I have this two models with a habtm relationship Entidad(entity) and
Persona(person), on the people view i want to see the entity/es he
belongs to and viceversa, so far so good.
The thing im getting stuck is with the form that handles the editing to
add more people to an entity, heres what i
2006 May 24
3
Real life use of multiple linked models in the same view
I''m pretty new to Rails and now, in order to fully learn RoR, I''m trying to replicate a project developed in Java using Hibernate+Tapestry. Tapestry is based on components and you can really use objects mappings in views like:
Example from the contact edit (view).
<input jwcid="@TextField" value="ognl:contact.name" />
<input
2010 Sep 21
6
Iterate HashWithIndifferentAccess
How do I iterate a HashWithIndifferentAccess? I need to set the order
using a sortable_element.
--
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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send
2006 Jul 04
8
writing to many_to_many table
I have three tables. users, posts, users_posts. This last one is to
mark a post as read.
How do I write to the users_post table?
Here''s what I have:
In model ''User_Post''
belongs_to :post
belongs_to :user
In post/view/show:
<%= link_to "Mark As Read", :controller => ''post'', :action =>
''post_read'',
:user =>
2006 Apr 01
12
Repost: Why is rails generating bad SQL?
It looks like I am missing something obvious. ActiveRecord is
generating _really_ bad SQL for this configuration, and I can''t quite
figure it out.
I''ve instrumented ActiveRecord enough to localize the problem somewhat,
and generally by this time I would have a good idea of what I was
missing because it''s all in the source.
It appears that something in
2005 May 12
26
performance update
I have made additional progress with regard to performance. My latest data:
configuration 1: r121.latest
configuration 2: r121p.latest
page c1 real c2 real c1 r/s c2 r/s c1/c2
/empty/index 6.75525 1.71983 148.0 581.5 3.93
/welcome/index 6.89044 1.89244 145.1 528.4 3.64
/rezept/index 4.99573
2006 Jun 13
17
reconstituting a date
In my view code, I have <%= datetime_select "in_out", "time_in" %>
which returns in params
:in_out: !map:HashWithIndifferentAccess
time_in(1i): "2006"
time_in(2i): "6"
time_in(3i): "12"
time_in(4i): "20"
time_in(5i): "24"
and I want to save that datetime to a column in the db...
if
2011 Mar 04
4
!map:HashWithIndifferentAccess
Hi All,
I have an extremely frustrating problem and I kind of think this is an
error in rails, but you never know.
I have a hash of objects that I am iterating through in order to display
the needed info. As I am doing that and displaying half a dozen values,
one value is being interrupted by rails as a hash and giving me this
error:
--- !map:HashWithIndifferentAccess comm: "1"
2009 Feb 09
2
how to get form parameters while using fields_for with nested attributes
hi all..
i am trying to use *fields_for* to get and save nested attributes in a form.
i have a ''Partner'' model associated with an ''Address'' model.
partner has_many :addresses
although the form is displaying fine, but on submitting it the following
error is shown:
*can''t convert HashWithIndifferentAccess into Array*
on this line:
*@partner =
2006 Feb 02
12
basic ''find'' question
I am struggling to understand the methodology here...
I have a find.rhtml
<%= start_form_tag :action => ''list2'', :first_name = client %>
<%# render :partial => ''form'' %>
<p><label for="client_first_name">First name</label><br/>
<%= text_field ''client'', ''first_name''
2006 May 14
0
Beware of HashWithIndifferentAccess#symbolize_keys!
Hi,
I just posted a patch tot he rails trac for a bug we found where
running symbolize_keys! on a HashWithIndifferentAccess will delete all
items from the hash. Please make sure you either never call
symbolize_keys! (or to_options! which just alias it) on a
HashWithIndifferentAccess, or apply the path attached from the ticket
at: http://dev.rubyonrails.org/ticket/5076
I also posted a much longer
2005 Nov 30
8
nested attributes with update_attributes()
Hi,
I am trying to use the update_attributes on object with nested
attributes and I am getting the following error:
ProductPrice expected, got HashWithIndifferentAccess
Here''s the situation (simplified):
class Product < ActiveRecord::Base
belongs_to :productPrice
end
class ProductPrice < ActiveRecord::Base
has_one :product,
:dependent => true
2008 Jan 21
1
specin'' update_attributes! + Hash
Hi,
I am facing a problem while trying to test a method that updates an
attribute. The attribute format should be converted to YAML format
before storing in the table which is excatly what is going on. But when
testing it using expectations in rspec it returns an error.
*** below is the error message :
Spec::Mocks::MockExpectationError in ''InteractController (submit) -
saving a form to
2007 Sep 25
16
putting away HashWithIndifferentAccess
Hey, campineros. And many good handshakes to zimbatm for getting
some patches applied.
So, yeah, I''d really like to get rid of any serious dependancies with
this 1.6 release. Anything that''s not in stdlib has to go. Of course,
camping-omnibus will still assume the whole ActiveRecord, Markaby,
Mongrel setup that''s in the history books.
Metaid can be removed and