similar to: find_or_initialize_by and Nested Resources

Displaying 20 results from an estimated 300 matches similar to: "find_or_initialize_by and Nested Resources"

2006 Aug 06
2
Acts as Most Popular plugin
Make your models feel like they are in high school again. This plugin retrieves the most frequently occurring values for each column. It adds methods of the form most_popular_[pluralized_column_name]. Check out <http://shanesbrain.net/articles/2006/08/04/acts-as-most-popular-rails-plugin> for sample usage. The plugin is mostly just a group_by in disguise. It is probably overkill if you
2008 Feb 08
4
x-post : find_or_initialize_by ActiveRecord bug? Ignores :conditions
Hello, I posted this on the rails talk group but received no response. Perhaps someone on this list could weigh in on whether this is expected/desired behavior or a bug that I should file and develop failing tests for (I doubt I have the active record method_missing fu to actually patch it). Test Scenario: I would like to find or initialize a new user and base the find on the users email
2006 Jul 18
0
Graphical stats with Rails Stats plugin
Rails Stats is a simplified graphical version of the Rake ''stats'' task. It generates a graph showing your lines of code versus lines of test code, and two other graphs showing the composition of your project and tests. The plugin requires Gruff Graphs. <http://shanesbrain.net/articles/2006/07/18/rails-stats-plugin-or-show-me-those-pretty-graphs> If not useful, I hope
2008 Feb 07
1
ActiveRecord 'find_or_initialize_by' dynamic finder bug? Ignoring conditions.
Hello all, I just ran into something that I think is a bug, and I would like to confirm with the core team whether this is expected/desired behavior or if this is a bug that I should file and develop failing tests for (I doubt I have the active record method_missing fu to actually patch it). Test Scenario: I would like to find or initialize a new user and base the find on the users email
2006 Jun 01
0
Possible RJS Implementation?
Hi there, I have a question regarding updating elements of a two different divs with one click. I have two lists. One list holds items that are entered into a contest, and the other list holds items that aren''t currently in the contest. One item can only be in one list at a time. Each list has a partial that renders the items with corresponding actions. The items in the current contest
2005 Dec 10
0
Paginate - Count(*) Broken or Am I Cheating?
I have the following paginator setup: @merch_pages, @merch = paginate :merch_item, :per_page => 15, :select => ''DISTINCT mi.id, mi.merch_image, mi.created_at, mi.artist_id, mi.item_description, art.sort_name'', :join => ''as mi JOIN merch_formats mf ON mi.id = mf.merch_item_id JOIN artists art ON mi.artist_id = art.id'', :order =>
2009 Mar 11
1
NoMethodError for select_tag
Hello there. I am following a tutorial with rails 2.1 and I have come across a problem where <%= f.label :artist_id %><br /> <%= f.select_tag(:artist_id, options_for_select([[''choose one'', '''']] + @artists.collect {|art| [art.name, art.id]}, @album.artist_id)) %> (Old artist info:<%= @album.artist_old%>) gives undefined method
2006 Jan 18
5
Perform action after in-place edit
I want to be able to call an action after performing an edit using the in-place editor macro. I want to update multiple divs so I was thinking about using an RJS template. However, I can''t figure out how to trigger another action after the method created by in_place_edit_for runs. Is there is an option on Ajax.InPlaceEditor where I can inject some Element.update calls? Thanks, Shane
2005 Dec 05
0
bug in bubbleshare's Active Record extensions?
I''m using add_foreign_key_constraint and remove_foreign_key_constraint from Bubbleshare''s Active Records Extension plugin now to manage the foreign key relationships I describe in my other recent posting. The constraints get added within migrations, but I''m running into two problems (Rails 0.14.3, PostgreSQL db): 1. Dumping the schema doesn''t dump the
2007 Nov 30
5
render_to_string in an after filter
I''m using render_to_string in an after_filter, which renders a partial that is sent to a web service. Here''s the code: class MyController < ApplicationController after_filter :post_to_webservice def show # show logic end def post_to_webservice stuff = render_to_string :partial => ''stuff'' webservice_post(stuff) end I get a DoubleRenderError in the
2007 Dec 05
7
Better RESTful routes with fb_sig_request_method
With the new fb_sig_request_method provided by Facebook, I''ve patched shanev''s pseudo-resource routes to generate restful routes, minus some exceptions. The announcement: http://www.facebook.com/developers/message.php#msg_126 Patch is submitted here: http://rubyforge.org/tracker/index.php?func=detail&aid=16105&group_id=4187&atid=16132 Blog entry about it:
2006 Dec 07
2
need to transfer data from old php like db to rails style db
hey all, I have two tables like that from an old php project: artists(id,name) albums(id,artist_id,album_name) and I need to transfer the data of this database to three tables that look like this: artists(id,name) albums(id,name) artists_albums(album_id,artist_id) any idea what''s the fastest query to do this? thanx in advance Pat --~--~---------~--~----~------------~-------~--~----~
2008 Mar 18
3
examples in subversion
Hey everyone. I have a quick question. Checking out facebooker as a plugin is currently really slow due to the example rails application. Would anyone object if I moved that out of the main plugin directory? Mike -- Mike Mangino http://www.elevatedrails.com
2008 Jan 16
10
Towards a 1.0 release
Hey everybody. I''ve been using Facebooker on several projects over the last few months and feel like it is really starting to mature. I''d like to push towards a 1.0 release within the next month. I''d really like everybody''s input on what still needs to be done, as well as some help in wrapping things up. I''ve created a list of things that still
2008 Mar 14
14
Facebooker MQ now on RubyForge
I don''t know if anyone is using this but I just fixed a bunch of bugs, some big ones, and moved this project to RubyForge SVN servers. So you can get it here now: script/plugin install http://facebooker-mq.rubyforge.org/svn/trunk/facebooker-mq/ This is working great for me on a couple of projects. Here is the README Updated: 3/14/2008 Purpose: The purpose of FacebookerMQ is to
2010 Aug 08
1
help me
i am creating an aplication where table name albums width attributes CREATE TABLE albums ( id int(11) NOT NULL auto_increment, title varchar(255) NOT NULL default '''', artist_old varchar(255) NOT NULL default '''', release_date datetime NOT NULL default ''0000-00-00 00:00:00'', genre varchar(50) NOT NULL default '''', created_at
2006 Jan 10
1
[AJAX] related drop-down list question
Hi all, I followed the example on: http://www.roryhansen.ca/?p=9 for creating related drop-down lists. However, this code actually creates HTML in the controller component: @albums = Album.find_all_by_artist_id(@params["artist_id"]) @html = "<select id=''album_id'' name=''album_id''>" @html += "<option
2006 May 04
4
form post not working
Hi there, I have this form code in a view: <%= start_form_tag :action => "listByArtist", :id => artist.id %> <p><b>List by Artist:</b> <select id="artist_id" name="artists[id]"> <%= options_from_collection_for_select(@artists, "id", "name") %> </select> <%= submit_tag "List"
2012 Jun 29
0
Can I make Rails update_attributes with nested form find existing records and add to collections instead of creating new ones?
Hi there, I''ve asked this question at stackoverflow.com http://stackoverflow.com/questions/11257662/can-i-make-rails-update-attributes-with-nested-form-find-existing-records-and-ad I haven''t seen a better answer than one I propose myself but I''d like to know if it''s possible to enhance accepts_nested_attribute_for to allow a find_or_create_by behavior for
2006 Jun 09
0
Calculations based on multiple tables
Hi there, I''m trying to grab all the contest_entries from a particular contest, and then grab all the appropriate contest_ratings associated with the songs and contest. The end result is an average score for each song involved in each contest. I made an ERD of my table structure which can be found at: http://antrover.com/erd/contest_question.jpg Here''s my model structure: