similar to: fix for modularized controller using overwrite_params

Displaying 20 results from an estimated 70000 matches similar to: "fix for modularized controller using overwrite_params"

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
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 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 Nov 19
1
link_to weirdness
Hi, I''ve got a page running at say http://example.com:3000/admin/players Then I''ve this bit of code to generate a URL like: http://example.com:3000/admin/players?order_col=fname&order_dir=desc <%=link_to col[:label], :overwrite_params => { :order_col => col[:field], :order_dir => @order_dir == ''asc'' ? ''desc'' :
2001 Jun 12
1
Mounting / as ext3 when ext3 is modularized in 2.4
Hello, I recently switched from 2.2 to 2.4 kernel. Each partition already contains a journal. I tried kernel-2.4.5-0.2.9 from RedHat Rawhide, where ext3/jbd is modularized. For the people who want to try this kernel, you first need to rebuild it, and enable CONFIG_JBD_DEBUG. This solves an unresolved symbol in jbd.o which prevents ext3 to load. (This issue will be solved in next RawHide) My
2006 Sep 27
7
problems with accessing controllers in sub tree directory
Hey guys, I used "script/generate controller admin/event" How do I link to the views and the controller when it''s inside a directory. I tried <%= link_to "some link", :controller=>"event",:action=>"index" %> <%= link_to "some link", :controller=>"admin/event",:action=>"index" %> <%=
2009 Mar 22
5
How does view know about instance vars set in controller?
Hi, I know that the AWDWR says to believe in magic and to not spend Xmas with people asking this question, but really how does it work under the hood? I was looking at the source code of crummy, and it seems that instance_variable_set and instance_variable_get may be part of the answer. Is there some resource on that or do I have to dive into Rails code? -- Posted via
2007 Jun 21
1
render :partial => :url - is it possible?
Hi, this is my first post to the list. I''m still learning the rails framework, having done most of my previous web development in PHP. I''ve done a bit of googling for the answer to this question, but maybe I''m just lacking the right word to search for. Several parts of my site, such as sidebar components, are self-contained, modularized and re-used in several parts
2007 Feb 19
2
help - how to call java classes from controller
hi, I need help to call java classes from the a controller action. I can call a java class from a ruby script, but when I am trying to call in controller, then require ''java'' itself gives me load error. I have java 1.4, jruby 0.9.0 and ruby 1.8.5 installed. I have tried to start server as : jruby script/server but it does not work. In my application I need to use 3rd party
2007 Jan 25
4
How to change the menu depending on the controller/method?
Hello, I''m still dtarting with ruby on rails. And I''m trying to have a menu depending on the current controller/method. Here is what I was thinking of (please tell me if there''s a better way to do it): I have a database with menu_groups (corresponding to controllers) and menu_elements(corresponding to methods). Each menu_element belongs to one menu_group. I created a
2007 Jun 30
3
return custom http responses from a controller?
Is it possible to have a response to the browser triggered prematurely in a controller? like before rails does all it''s internal processing? also if so can I change the content-type for the response? thanks -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups
2007 Sep 19
3
link_to method of different controller
I want to link to a method of a different controller. I thought I new how to do this but the code that I have is not working: <%= link_to ''Welcome Page'', { :action => ''index'', :controller => ''music_controller'' } %> Any ideas, thanks ~S -- Posted via http://www.ruby-forum.com/.
2007 Sep 12
10
Need help refactoring a controller, perhaps add threading?
Good morning, I''ve been working on my first Rails app. I''m replacing an old Perl script that scrapes a bunch of data from an Oracle database, generates a bunch of charts then builds a static webpage with the charts. I''ve re-built it in Rails, with about 25% of the code it took to do in Perl and the users can now get dynamic charts instead of day old charts (or
2008 Feb 22
12
DRY - in controller or model????
Hello. I''m trying to make clean efficient code and would like to find out if there is a "BEST" way to write code. I want this to run quickly and efficiently for my app. I''ve got a form that needs a select list created for new and edit functions. Same list. Do I do this in the controller and reference @list in the forms? def new @list = %w { apple orange banana }
2007 Nov 19
2
Help with controller and view
I have the following models class Recipe < ActiveRecord::Base has_many :ingredient_recipes has_many :ingredients, :through => :ingredient_recipes end class IngredientRecipe < ActiveRecord::Base belongs_to :ingredient belongs_to :recipe end class Ingredient < ActiveRecord::Base has_many :ingredient_recipes has_many :recipes, :through => :ingredient_recipes
2007 Mar 26
2
Calling a controller action from script/console or runner
Is there a way to call or invoke a controller method from script/console or script/runner? The reason is that I''d like to pre-cache some of the actions on my controller. The pseudo code below is what I''d like to be able to do: class MyController < ApplicationController caches_action :test def test puts ''Hi there'' end end script/console:
2008 Jul 10
5
Uninitialized constant (controller/model)
NameError in StoreController#add_to_cart uninitialized constant StoreController::Cart This is the controller: class StoreController < ApplicationController def index @products = Product.find_products_for_sale end def add_to_cart @cart = find_cart product = Product.find(params[:id]) @cart.add_product(product) end private def find_cart session[:cart] ||=
2007 Dec 07
4
capitalizing an attribute - view, controller, or model?
The users will enter students names on forms. How do I intercept the first and last names and have them stored capitalized when the user inputs them in lower case? Do I mess with the form html, skipping form_for helpers and using conditional clauses in the view? Do I need to separate out the individual attribute and update it separately in the controller actions that save/updates the
2007 Sep 10
3
Can't reach a controller :(
When I try to see a controller I get a 404 error, this is what WEBrick says What could it be? Thanks for the help ;) => Booting WEBrick... => Rails application started on http://0.0.0.0:3000 => Ctrl-C to shutdown server; call with --help for options [2007-09-10 13:30:26] INFO WEBrick 1.3.1 [2007-09-10 13:30:26] INFO ruby 1.8.6 (2007-06-07) [i486-linux] [2007-09-10 13:30:26] INFO
2008 Feb 24
3
params checking in controller before real action
I want to perform certain action in controller based on request parameters. Is there some way to access params in controller before a real action? Like in following code: class UsersController < ApplicationController # params[:type] in here does not work ssl_required :create if params[:type]=="something" def create # params[:type] works in here. end end If not,