similar to: link_to weirdness

Displaying 20 results from an estimated 300 matches similar to: "link_to weirdness"

2005 Sep 06
4
url_for: :overwrite_params went missing
Somewhere between 0.13.1 and the current SVN version the :overwrite_params option to url_for (and related methods) went missing. I can''t tell whether this was deliberate or by mistake, and I have no idea how to get the same functionality in some other way either. Michael -- Michael Schuerig Life is what happens
2006 Nov 21
1
fix for modularized controller using overwrite_params
Hey guys, I realized some people have had problems with nested controllers and the :overwrite_params call. The way I fixed it is like this: :overwrite_params=>{:controller=>"/#{params[:controller]}"} I would love to see if other people could improve on this, its not the prettiest thing. -- Posted via http://www.ruby-forum.com/.
2007 Apr 09
8
How do I use link_to with all the current options?
In one of my pages I want to create some URLs that go to the same page, but tack on an extra parameter (column sorting stuff). How do I do that? I''ve tried link_to "Title", :sort => "title" and that''s pretty close...it keeps the controller name, but it doesn''t include one of the parameters. I''m using nested routes, so the URL should
2005 Mar 03
0
where is :overwrite_params ?
HI, it seems the :overwrite_params option has disappeared from the url_builder. Is there a reason or is it just a side effect of the new routes? Any chances to see it coming back? If that matters, I use it a lot :-) Raph PS: For those who don''t know it, it lets you use the current @params as parameters for eg link_to, just overwriting the values you want. For example, when displaying
2007 Oct 08
6
spec''in controllers request for nested routes
describe PlayersController, "handling GET /saltmines/games/1/players" do before do @game = mock_model(Game, :to_param => "1") @game.stub_association!(:players, :find => mock_model(Player)) end def do_get get :index, :game_id => @game end it "should be successful" do do_get response.should be_success end it "should
2009 Dec 21
3
beginner problem
Hi, I´m starting using rails. I have one problem. I create a controller, the code is the next: class PlayersController < ApplicationController scaffold:player end I did all the things that I suppose to do, but a problem appears when try to open my webpage application. The error is the next NoMethodError in PlayersController#index undefined method `scaffold'' for
2005 Nov 16
3
controller before_filter issues
Hi, Some controller filters: before_filter :require_logged_in, :only => [:create, :new, :confirm] before_filter :init_players, :only => [:create, :new, :confirm] The first one, you guessed it, redirects a user if he''s not logged in. Now when I hit this page and I''m not logged in, the 2nd filter gets executed and throws an error, because it depends on the user
2006 Apr 18
6
Best Practice for Returning to Calling Page?
I have a partial, it''s a shopping cart display, it''s designed to appear on several different pages of my site. One of the buttons on the shopping cart empties the cart, and then I want the calling page to redisplay. In other words, the cart controller needs to return the visitor to the same page -- however since the cart could appear on any given page, this has to be
2006 Jan 23
2
UserEngine -- Permission.synchronize_with_controllers -- trouble with my own controller modules
I suspect there''s an easier version of this question that I could ask, but I''m not sure where I''m going wrong. I have LoginEngine and UserEngine setup and seemingly running fine. However, not all of my controllers are being found when I run "rake sync_permissions". Specifically, it''s the controllers that are not in the base controllers folder, but
2005 Nov 27
5
OT: good admin gui postgresql on OSX?
Hi, I recently bought by first Mac and I''m looking for some alternatives for my windows applications. Does anybody know a decent gui admin app for postgresql? On windows I use postgresql manager: http://www.sqlmanager.net/en/products/postgresql/manager I find this a very good piece of software and it''s free, even though I paid a little for some extra features. I''d
2006 Apr 25
6
Does Rails need more useful URL helpers?
Similar topic to my last post, but a different brand of methods. In particular, the url_for and link_to methods have come to bother me at times. I will mention one instance in particular: I am designing a high-end administrative interface. This interface supports paging, sorting and limiting to specific field values. Thus I have params named page, sort and limit. The lack of elegance I see
2007 Nov 17
0
Postgres sequencer and rails
Hi All, I''m wrestle with postgres database and rails. Finally it''s working but i need some explanation : So : I have a sequencer : CREATE SEQUENCE players_id_seq INCREMENT 1 MINVALUE 1 MAXVALUE 9223372036854775807 START 4 CACHE 1; ALTER TABLE players_id_seq OWNER TO squash; Table : CREATE TABLE players ( id bigserial NOT NULL, firstname character varying,
2005 Dec 20
8
Using rails with stored procedures
Hi all! I am quite new to rails, and I would like to know if there is a tutorial, or if someone can tell me how to use rails with stored procedures and views. Any help would be appreciated. Thanks to all -- ------------------------------------------- Gioachino Bartolotta
2008 Sep 06
6
Configuring custom library
Hi, I''ve added a custom library called lib\AccountSystem like so: "module AccountSystem SINGLE = 1 MULTIPLE = 2 class << self attr_accessor :account_system_type end end" Now I wanna configure AccountSystem.account_system_type=AccountSystem::SINGLE in one app. I used an initializer: config/initializers/account_initialization.rb where I put this line in. I
2007 Oct 05
7
Easy AR association stubbing
I''ve added a method to the mock class that makes it pretty easy to stub associations in rails. I''ve been using it for awhile and it seems to cut down on a lot of setup code for the controller and model specs that use associations. #before @person = mock_model(Person) posts = mock(''post_proxy'') posts.stub!(:build).and_return(mock_model(Post, :save => true))
2005 Dec 23
6
Agile book - test error
Hi all, I get an error when testing the "store_controller_test.rb" The troublesome line is in the test below: def test_add_to_cart get :add_to_cart, :id => @version_control_book.id <<< cart = session[:cart] assert_equal @version_control_book.price, cart.total_price assert_redirected_to :action => ''display_cart'' follow_redirect
2008 Dec 19
2
before_filter for a specific controller/action
I''m learning about before_filter, implementing a simple "you must be logged on" thing. It works great, but I need to allow people to create a player as well. By writing the except as attached, that works, but then everyone has access to all "new" methods, which I don''t really want. Can someone help me with how to properly construct this to limit non-logged
2004 Oct 25
1
Rails 0.8: Just shy of 100 additions, changes, tweaks, and fixes!
It''s been fifty days since our last confession, so it''s no wonder that this outpouring is by far the biggest yet in Rails history. It''s absolutely packed with goodies ranging from a whole new framework for sending email to the smallest new alias for an existing method. In total we''re just shy of 100 additions, changes, tweaks, and fixes. This is also
2005 Dec 23
5
Can''t get data from products into @order
I went throught the "agile web developemnt with rails" and Now I''m trying to ''enhance'' the code with some extra options. When I go to admin/shipping I want to include some data from the products table in with the order info listed. I can''t seem to get this to work. in my partial form I''m trying to add this: <td
2007 Jul 06
1
Edge, link_to and mocks
Hi All, Anyone noticed that using the newer link_to syntax in edge currently fails with mocked objects in view specs or helpers. eg. if you have something like the following in your view (or equivalent in a helper): <%= link_to @dog.name, @dog %> as opposed to the current 1.2 syntax: <%= link_to @dog.name, dog_path(@dog) %> Using a mock_model as the ''dog''