similar to: model creating a model?

Displaying 20 results from an estimated 8000 matches similar to: "model creating a model?"

2008 Jan 21
7
undefined method error
Hello everyone, I am following the Practical Rails: Social Networking sites book. In chapter 7 photo gallery I am getting a NoMethodError in Pages#show Showing layouts/_menu.rhtml where line #12 raised: undefined method `new_entry_path'' for #<ActionView::Base:0x52fa56c> Extracted source (around line #12): 9: <% if is_logged_in? %> 10:
2007 Dec 28
1
validation of acts_as_list in the model of the base class?
Lets say I have 3 models, user, user_group and user_group_nodes. A normal user has one user_group_id as a foreign key and a special user has multiple user_groups which are defined in the user_group_nodes. The user_group_nodes is a "acts_as_list" for user and contains a list of group_ids. When I build a form to get user input and I want to save it, is there a way to validate the
2008 Jan 08
7
script/server: Permission denied
when I run script/server I get this error: script/server: Permission denied I''ve been running this app for awhile now. Not sure what would have caused the change. Any ideas? I''ve messed around with permissions on the script folder but nothing seems to work. thanks -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received
2007 Dec 22
3
Formatting looping display from mySQL table
Hi I''m a noob to RoR. I have everything setup but can''t figure out to get the list display as I would like. I''m sure this is very simple stuff. I just haven''t figured it out yet :( I hope someone can point me in the right direction :) I have a mysql table "websites". In it I have the following columns - Name, Url, Banner, Description I created
2008 Feb 24
3
1 error(s) on assignment of multiparameter attributes
I am trying to create a form for processing credit cards. For the credit card expiration date, I would like to leave the day field out of the form for obvious reasons. However, the following code is producing an error for me. Any ideas? Thanks! <p><label for="email">Expiration</label><br/> <input type="hidden" id="user_card_expiration_3i"
2008 Mar 28
10
Inheriting from AdminController intstead from ApplicationController
Hi I would like to do the following: I have created an admin namespace and the required folders app/admin views/admin etc. And then I wanted all controllers under app/admin to inherit from a controller named AdminController which resists under app/admin/admin.rb instead of inhereting from ApplicationController, so I could better separate between admin and public section. The AdminController
2007 Dec 27
6
ActiveResource and (polymorphic) associations
Hi, I''m just playing with ActiveResource and I did''nt find anything about the support of (polymorphic) associations. Is there a support at all? Thanks in advance --~--~---------~--~----~------------~-------~--~----~ 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
2008 Jan 21
4
Caching CSS Issue
I have a problem I was hoping someone could shed some light on. I noticed that with every request to my server, the css file was being requested. I went ahead and made a static link to the css file so there is no query string at all, but still I see the requests coming in with each request. Do I need to do anything else (in the response header maybe?) to make sure that browsers will cache the
2008 Jan 30
6
Rails 2.1
There''s been some great stuff added to edge since 2.0.2. Any chance it might be wrapped up into a 2.1 release? Cheers Chris -- ---------------- http://pushrod.wordpress.com -- old dogs, new tricks http://autopendium.com -- a place your old car can call home --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups
2008 Jan 15
2
rails rjs page object
Can anyone point me to api documentation for the page object that is used in rails rjs files? Thanks --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send
2008 Jan 21
13
has_many with different primary key
I''ve got quite the ActiveRecord challenge, any help would be appreciated. In my current project Companies can have many reviews. class Company < ActiveRecord::Base has_many :reviews, :as => :reviewable end However, my company table, I have two different IDs to identify my company. id - This is the typical id we use for normal stuff other_company_id - This is the id we use
2008 Feb 11
6
Should I Test My Fixtures?
I have a number of fixtures in my test suite. For example, with acts_as_authenticated and acts_as_state_machine, I created a number of users in different account states for use in functional testing. (Suspended users can not log in, etc) Is it a good idea to run fixtures through tests to ensure that they conform to their ideals? EG: assert users(:suspended_user).suspended? If so, where should
2007 Dec 23
11
return day from date (javascript) ?
Ok, I know this isn''t a Rails problem, but if you could help me out that''d be brill. I''ve used JavaScript to create a new Date object containing a date of my choice... mydate = new Date("11/24/2007"); //going with Javascript''s mm/dd/yyyy format now this is good, what i want to do now is put in an integer variable the number for the day, in this case
2008 Jan 02
5
polymorphic assosciations - still the way in Rails 2.0.x
I store a lot of information concerning blogs, events, books, bla bla... So I have a lot of database tables including the same fields: url, user_id, subject, comment..... So I decided to use polymorphic assosciations. Is this still the prefered way in 2.0.x or does Rails 2.0.x offers me a easier, faster and more preferable way to do this? By the way, isn''t it much easier to do all the
2008 May 09
6
Operator Names.
What is this ''=>'' operator called? Does it have a name? --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to
2008 Jan 08
3
What happened to _form.rhtml partial in rails 2.0??
Just wondering if anyone could point me to a good explanation of why the latest way of doing things does not include using something like _form.html.erb partials in RESTful rails 2.0?? Why did we move away from partials, etc?? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To
2006 Jul 22
7
Validation with has_many
I have two problems. I have a comment that has_many uploads. Before saving the comment, I want to be sure that the upload(s) has passed validation, but I also need to validate in other ways. For example, I do not want to save the comment if there is no comment or upload. Or, I do not want to save the comment if the image has been uploaded previously (comparing md5s with past upload md5s
2008 Jan 23
11
Rails 2.0.2 + RJS
Hi I had ajax commenting on my app, which worked perfectly on Rails v1.2.6, but does not work the same in Rails 2.02. Basically the comment gets added, but the visual effects do not work (ie lines 2 + 3 of create.rjs) create.js page.insert_html :bottom, ''comments'', :partial => ''comment'' page.visual_effect :appear, "comment_#{@comment.id}"
2008 Jan 01
2
un cache a page
how do i un-cache a page? i updated my application, and every works but the cached pages. for the cached pages, the old pages appear. thanks -- 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
2007 Dec 10
10
Reading Hash/Array
Hi all, My app is generating a form with several bill_items that should be updated (fields to be updated are description and net). The text_field_tag names are bill_item[update][#{id}][description] and bill_item[update][#{id}][net] (and I added bill_item[update][#{id}] [id] just in case) The param received is: {"commit"=>"Save",