similar to: customizing layouts for functions

Displaying 20 results from an estimated 5000 matches similar to: "customizing layouts for functions"

2006 Jul 18
4
Multiple Layouts - Single Controller
How do I do multiple layouts for a single controller: I am aware I can do... render(:layout =>''mylayout'') for individual actions, however this becomes a multiple render problem. I tried this... layout "mylayout", :except => [:myaction, :myotheraction] layout "myotherlayout", :only => [:myaction, :myotheraction] However that doesn''t
2006 Mar 01
15
Is there a perl equivalent of .= in ruby/rails??
I want to make a for loop that concats strings onto a variable: html .= var1 + "this is a test" + whatever What is the syntax that does this in ruby/rails? Also, is there a ''print'' method in ruby? Because when I try to use render_text it will only let me use this once. -- Posted via http://www.ruby-forum.com/.
2006 Mar 31
3
Need to use a method without the layout
I need to use a method (called by one of my controllers) without using the layout. All the other methods in the controller need to use this layout except for thismethod (becausae it''s called by an Ajax script). I know how to use :layout=>layout_name when calling a method from another method, but nothing is calling this. The layout needs to be removed in the method itself or I need
2006 Feb 21
4
displaying double digits
Hi, I have a question about displaying digits in Rails. whenever I print the price of an item, if the last digit is a zero or double zeros then it doesn''t display properly. How do I display a number so that it looks like currency? thank you! -- Posted via http://www.ruby-forum.com/.
2006 Jun 22
4
rendering partials in layouts?
Hello all, Forgive me if this is a really stupid question. How do you render partials in a layout? It''s probably way easier than i believe it to be. thanks! -- Posted via http://www.ruby-forum.com/.
2006 Apr 06
2
Quick Question: Using a CSS class statement in a link_to tag
Hi, I have a css file with lots of classes. I want different links on my page (which all use the ''link_to'' tag) to belong to different classes so that I can format their font, size, color, etc. Where or how do I use the css class name in the link_to tag? Thank you very much -- Posted via http://www.ruby-forum.com/.
2006 Aug 12
2
Layouts: application.rhtml v. mycontroller.rhtml
I was trying to be all DRY and standardize my layouts to one file and made an application.rhtml. There was no application.rhtml at all before. So I renamed all my controller layouts to .txt and then tested. I got empty pages. I found some issues with Login/UserEngine and application.rhtml, but nothing that looked like this behavior. Is routing messing me up? It''s as if
2006 Jan 16
3
routing to controller inside module
Hey, am i to stupid to find the information about how to route to a controller in a module? Maybe module support has gone! The controller is under: app/controllers/admin/my_controller.rb The my_controller.rb file looks like this: module Admin class MyController def index render :text => ''Hello!'' end end end How does a route to all controllers under module
2006 Feb 03
2
testing to see if emails are sent out on exceptions
Hi, I''m using ActionController::rescue_action_in_public() to send emails when uncaught exceptions happen. Is it possible to write tests for that? Joe
2007 Dec 05
4
render :update and controller private methods
Probably asked and answered, but... Why are controller private methods inaccessible inside the block passed to render :update ? This does not work: class MyController < ApplicationController def some_action render :update do |page| page.replace_html ''an_element'', some_private_method end end private def some_private_method return
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:
2006 May 14
12
Is there a place for java in Ruby on Rails apps?
Hi all, I''m asking this question from the standpoint of a developer with almost 10 years experience with Microsoft technologies, mostly doing server side component and database work. So, I''m not very familiar with the java world. Can anyon tell me how/if java development can complement Ruby on Rails development? I''m not interested in how java can duplicate Rails
2010 Jul 05
1
[PATCH] gettext initiation problem Thanks to Thibault Deloffre <tdeloffre@linagora.com>
From: root <root at ovirt.admin.virt.par.lng> Signed-off-by: root <root at ovirt.admin.virt.par.lng> --- src/app/controllers/application_controller.rb | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/src/app/controllers/application_controller.rb b/src/app/controllers/application_controller.rb index 4c4666e..c7f8431 100644 ---
2010 Mar 31
1
[PATCH] Upgrading the server to work with Rails 2.3.4.
Signed-off-by: Darryl L. Pierce <dpierce at redhat.com> --- src/app/controllers/application_controller.rb | 2 +- src/config/environment.rb | 2 +- src/config/initializers/new_rails_defaults.rb | 6 +++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/app/controllers/application_controller.rb b/src/app/controllers/application_controller.rb
2007 Aug 13
8
How to use expect_render?
Hi: I am a rspec beginner. I have scratched my head for the whole afternoon, trying to figure out a way of writing render expectation in controller spec. However, I failed. It kept telling me that the ''expect_render'' was an undefined method. I have installed rspec 1.0.8 and rspec_on_rails as well. Below is the controller to be tested. Controller def index pre
2007 Apr 05
3
Extending assigns in controller specs?
Hello, I am interested in enhancing assigns in controller specs to do things like the following assigns[:key1, :key2, :key3] #=> vals for keys Is there away to "break open" this construction to overload the :[] operator? Thanks. -Chris
2006 Feb 08
5
Can rails cache a table?
We have a few tables that do not change, unless something big happens which will only happen when it is time to deploy. Is there a way to get Rails to cache the contents of these tables? We can''t just go to config files or not DB models for reasons I won''t get into. Thanks, Dave -------------- next part -------------- An HTML attachment was scrubbed... URL:
2006 Apr 10
2
using web service for authenitcation
I am writting a web service for authenitcation of users and was using web_service_scaffold :invoke for testing it out...and was able to consume it using .NET. But my question is, whats the simplest method using which i can use the same web service in the current Web App. I mean, not from an external application or something but from the current web apps itself. I found one method in AWDR, and
2006 Sep 15
3
How to catch a parameter that contains a full url
Hi I need some help! I have controller that I need to pass a full url (with its own parametrs) as a parameter, e.g. I want to call my controller with: /mycontroller/catchurl?url=http://somedomain.com/afile.jsp?param1=xx&param2=yy and in action "catchurl" in mycontroller.rb I would like to have params[:url] to be "http://somedomain.com/afile.jsp?param1=xx&param2=yy"
2006 May 21
6
Is there a way to call helper methods in a controller?
Hi, Is there a way to call helper methods in a controller? I want to do something like this in my controller Class MyController < Action.... def my_method string = link_to "some_url", :controller => "home", :action => "command" end end link_to is an ActionView helper method and it seems that I couldn''t access the method in the controller