similar to: #dom_id should use AR#to_param instead of AR#id

Displaying 20 results from an estimated 9000 matches similar to: "#dom_id should use AR#to_param instead of AR#id"

2013 Apr 12
1
What is the meaning of the method to_param?
Hey! Foe example i have next code: test "should update user" do put :update, id: @user.to_param, user: @input_attributes assert_redirected_to users_path end What return id: @user.to_param? -- 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 unsubscribe from this group
2006 Feb 01
0
to_param() / url generation Question
I''m trying to implement the to_param method to allow url generation to be in the format of /:category_name/:article_permalink (as discussed on page 299 of Agile Web Development With Rails). I expect that I need to override/implement the to_param method and have it return the category_name for the category model and the article_permalink for my article model, but I haven''t
2008 Sep 11
1
cached_models
Hi all, Yesterday I released a new Rails plugin: cached_models. It allows to transparently use the internal Rails cache mechanism in your models, avoiding to write code for expiring policies. Example class Project < ActiveRecord::Base has_many :developers, :cached => true end class Developer < ActiveRecord::Base belongs_to :project, :cached => true end # Automatic cache, all
2006 Oct 26
2
Mocha and SimplyHelpful
Hi, I''m getting a conflict between the Mocha plugin and the Rails SimplyHelpful plugin. For some reason the dom_id method from SimplyHelpful is not being found in my views when the Mocha plugin is installed. The dom_id method if used in the controller works properly. This is the error I get when running the tests: 1) Error: test_truth(HmmControllerTest):
2007 Oct 23
2
to_json inconsistency?
Hello, ActiveSupport::JSON::Variable.to_json is the only to_json without an "options" parameter. Is this intended? For example, this code in a .rjs page[@user.dom_id].visual_effect :drop_out, :afterFinish => ActiveSupport::JSON::Variable.new("foo") fails with ActionView::TemplateError: wrong number of arguments (1 for 0) On line #7 of
2010 Jun 12
0
[PATCH] ActionDispatch MemCacheStore violates encapsulation principle
When pass :cache param to ActionDispatch::Session::MemCacheStore, it should be removed from options, otherwise it remains "published". This violates the OOP encapsulation principle. I created a LH ticket with a patch http://bit.ly/cGDaWs Luca -- lucaguidi.com twitter.com/jodosha -- You received this message because you are subscribed to the Google Groups "Ruby on Rails:
2006 Jan 18
1
using unique varchar instead of id
Hi, I just signed up so ''hello everybody''. As the title suggests, I was wondering if there was an easy way to specify that I want all actions/controls to be based upon a particular parameter rather than :id (in this case :unique_name). I don''t :id to appear in URLs or elsewhere, I want it all to work from :unique_name. It seems like something that I should be able to
2006 May 17
6
ActiveRecord#to_param
Hello, to implement some some kind of optimistic locking, I want to build a view, where an object is displayed together with a link containing the data of the displayed object. My first try looked something like <%= object.object_discription %> <%= link_to "action", :action => "take_action", :data => object %> this won''t work because object is of
2008 Jan 03
0
remote_form_for with auto_complete_field
Hi friends I have problem with auto_complete_field. I have used auto_complete_field with in the remote_form_for. But when we enter the text in auto_complete_field two actions are calling 1. auto_complete_field action 2. remote_form_for action I need to restrict the form action when we enter text on auto_complete_field Could u give any ideas? <div
2009 Dec 13
0
r65 committed - Use the GeoCommons addOverlay method
Revision: 65 Author: ajturner Date: Sun Dec 13 11:10:04 2009 Log: Use the GeoCommons addOverlay method http://code.google.com/p/mapstraction/source/detail?r=65 Modified: /trunk/source/mxn.geocommons.core.js /trunk/tests/index.htm ======================================= --- /trunk/source/mxn.geocommons.core.js Sun Dec 13 11:10:00 2009 +++ /trunk/source/mxn.geocommons.core.js Sun Dec 13
2007 Oct 06
1
2.0 release train and a tiny ARes fix needs review
Are we too late for minor fixes to hop onto the Rails 2.0 train? This little guy needs some +1 love. He adds ARes::Base#to_param: http://dev.rubyonrails.org/ticket/9557 Cheers, Brad --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to
2008 Jan 21
2
multiple ids on restful action
Hi, I know this question has come up before, but I couldn''t find a satisfying answer. Maybe I didn''t look well enough, so any pointers to old messages regarding this subject would be welcome too. I need some way to pass multiple ids to a resource. Something like /posts/13,14 If I do this I have to manually split the id on ","s in the action, and use post_path([post1,
2006 Feb 14
1
in a domU, 6 network interfaces wanted, only 3 seen
Hello, I need 6 virtual interfaces in a domU (which will be our firewall). I''ve created 6 bridges in dom0, configured everything correctly... When I start the domU, it can only see 3 of them : eth0, eth1, eth2. However, the bridges in dom0 are correctly configured, and I can see all 6 vifs (from vif<DOM_ID>.0 to vif<DOM_ID>.5) when using "brctl show". On the
2007 Jan 24
2
A spec where interaction-based testing breaks down... (at least for now)
Here are the specs: context "Finding all the stylesheets available to a company" do setup do @mock_company = mock("company") @mock_company.stub!(:to_param).and_return "1" Stylesheet.stub!(:find) end def do_find Stylesheet.find_available_to @mock_company end specify "should convert the company into a parameter" do
2008 Feb 13
6
trouble updating partial from collection
I have a view where I render a partial over a collection. Each instance of the partial includes a <div> with an id specific to that instance. Inside the partial, there is a select tag for "year". I''m trying to change some of the contents of the partial when user changes the year. I''m using this in the view: <%= select_tag :year,
2008 Nov 19
3
Rails.cache and problem with model id?
I have the following: MODEL: def self.get_tag_cloud Rails.cache.fetch(''fetish_tag_cloud'', :expires_in => 1.hour) do find(:all, :conditions => [ "approved_for_tag_cloud = true"], :order => "LTRIM(name)") end end CONTROLLER: def index @fetishes = Fetish.get_tag_cloud end VIEW: .... <% @fetishes.each do |fetish| -%>
2011 Mar 02
0
polymorphic_path not getting generated
Folks, I am trying to use the Savage Beast plugin in a polymorphic way. I have setup my model as below # Leaving out other details from models class Forum < ActiveRecord::Base has_one :recent_topic, :class_name => ''Topic'', :order => ''sticky desc, replied_at desc'' belongs_to :forum_owner, :polymorphic => true # Helps keep track of which
2007 Jul 16
0
Ajax works in FF but not safari!
The following code works perfectly in FF, but does not work in safari. I''m on Edge Rails with the latest javascripts. Any clue what''s going on? CONTROLLER: def create @program = @school.programs.new(params[:program]) if @program.save render :update do |page| page[:program_list].replace_html(:partial => ''program'', :collection =>
2006 Apr 07
2
ActiveRecord find all based on array -- need ids from array
Does anyone know if it is possible to perform an ActiveRecord find by passing in an array? I would like to be able to do the following: MyModel.find(:all, :conditions => ["user_id in (?)", users]) The problem I run into is that the returned SQL contains the to_s() output of the User object, not the ids of those users. Is it possible to change this behavior? I attempted to
2006 Dec 25
1
Urgent - Setup DoveCot with Plesk
Hey, all, I am trying to setup DoveCot with Plesk. But I could not go through the last step. Setup: MySQL 5.0.22 Qmail Plesk 7.5 DoveCot v1.0 RC15 The problem: I setup sql.conf for user query and password query. I tried different ways, DoveCot always says "Authentication failed". Here are my two SQLs. user_query = SELECT concat('/var/qmail/mailnames/', d.name, '/',