search for: action_name

Displaying 20 results from an estimated 132 matches for "action_name".

2006 Mar 08
7
Function could determine the caller action ?
Is it possible to determine which action call the function ? In example, func_test in ApplicationController could determine which action from SiteController is calling her ? in class ApplicationController I have def func_test if ( calling from index ) return "1" end if ( calling from contact ) return "2" end end and in class SiteController def
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
2010 Sep 06
5
how to call rails method from javascript method.
hi I wanna call rails method from the javascript method. It should be ajax call for rails method. please help me. -- 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 post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe
2006 May 25
1
Built-in var. action_name for controllers?
All, In the Recipes for Rails Authentication recipe, there is a variable named action_name that''s used to represent the current action. Where does this come from? Is there a similar variable for the current controller? Thanks, Wes -- Posted via http://www.ruby-forum.com/.
2009 Mar 05
4
before_filter :action_name OR :action_name
Hi there I am wondering if we can use before_filter in the form of :action OR :action what i want to do is to implement one of the actions, if the first failed, then go to the second when i use before_filter :action1 before_filter :action2 each method will run them, my case is that i want to check if one of them is true and not both any idea?
2006 Apr 20
8
2 layouts per .rb page
Hi, Is this possible ive got layout "loggedout_layout", :only => [:login, :logout] but I also want to do somthing like layout "loggedin_layout", :except => [:login, :logout] When the second one is introduced it seems to cancel out the first request, any suggestions how to get around this? Scott -- Posted via http://www.ruby-forum.com/.
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
2006 Mar 27
3
Specify a controller action via attribute in INPUT tag?
I have a pre-existing form with one existing "SUBMIT" tag generated by <%= submit_tag %> I would like to add another <INPUT type="submit" ...> to my form. How do I successfully associate that <INPUT> tag with a different controller action than the default one specified by my <%= start_form_tag %>? Or does this approach even make sense? In RoR, is
2006 Apr 27
3
Routing problem
Hi, I am having a routing problem and can''t figure out why its happing. I have added the following line in my routing.rb file. map.connect ''name/:id'', :controller => ''controller_name'', :action => ''action_name'' When I use http://domain.com/controller_name/action_name/id then it works fine on the local machine using webrick as well as on a live site using apache. But when I use http://domain.com/name/id then it crashes the webrick on local machine and gives the regular "Application error...
2009 Jun 07
6
Missing Template when testing with the Brain Buster Captcha partial
...rain_buster/views/brain_busters On line #23 of app/views/contacts/_form.html.erb 20: <%= f.label :message %><br /> 21: <%= f.text_area :message %> 22: </div> 23: <%= render :partial => ''/captcha'' unless action_name == ''edit'' %> 24: <div><%= f.submit "Submit" %></div> 25: <% end %> app/views/contacts/_form.html.erb:23 app/views/contacts/_form.html.erb:1 app/views/contacts/edit.html.erb:1 app/controllers/co...
2006 Jun 30
5
If / Else Form layout question.
Hello all, I''m using the following _form.rhtml layout for a number of pages, including edit record and new record (which each has it''s own definition in the controller). I''d like to display a different author form field depending on which page they are using. I''d rather keep using _form.rhtml as a layout template, instead of customizing each separate page.
2006 Aug 01
8
Decoupled observers for controllers?
In the Rails Recipes book the recipe "Keeping track of who did what" explains how to do decoupled observing of models. In my application I''d like to do a similar thing but watching the controllers. For example, when somebody hits the login method of the Security controller, I''d like to make a note of it. In this case I could observe the User model and watch for
2006 May 23
3
image_tag problem
Hiall, I want to make an image_tag from within a controller in order to be able to present a link (with a status image) in a view. Here is my controller method (in file webca_controller.rb, hence WebcaController) def untouched_status_image_tag image_tag("open", { :alt => "Offen", :title => "Offen", :size => "12x12", :class =>
2006 Jan 12
4
If statement based on a action
Question for you all is it possible to use an action in an if statement? I am using the same form for edit and new and I have a cancel button on the page. This cancel button is built with an if statement that looks right now to see if a parameter exists to define where to go back to if the user cancel. The problem occurs when the user submits the form and there are missing fields by
2005 May 01
5
Example using Builder::XmlMarkup and .rxml files?
...ontroller < ApplicationController layout ''accounts'' model :account def edit @edit_p = "place holder example para" end end I want to understand how to convert the scaffold generated layout: <html> <head> <title>: <%= controller.action_name %></title> <%= stylesheet_link_tag ''scaffold'' %> </head> <body> <%= @content_for_layout %> </body> </html> and template: <h1>Editing accounts</h1> <%= start_form_tag :action => ''update'', :id =&...
2018 Nov 05
0
[PATCH 2/2] p2v: add a Shutdown action (RHBZ#1642044)
...K (shutdown_clicked), NULL); g_signal_connect (G_OBJECT (reboot_menu_item), "activate", G_CALLBACK (reboot_clicked), NULL); #endif @@ -2255,7 +2264,9 @@ static void activate_action (GSimpleAction *action, GVariant *parameter, gpointer user_data) { const char *action_name = g_action_get_name (G_ACTION (action)); - if (STREQ (action_name, "reboot")) + if (STREQ (action_name, "shutdown")) + shutdown_clicked (NULL, user_data); + else if (STREQ (action_name, "reboot")) reboot_clicked (NULL, user_data); } #else @@ -2269,6 +2280,...
2018 Nov 06
0
[PATCH v2 2/2] p2v: add a Shutdown action (RHBZ#1642044)
...K (shutdown_clicked), NULL); g_signal_connect (G_OBJECT (reboot_menu_item), "activate", G_CALLBACK (reboot_clicked), NULL); #endif @@ -2255,7 +2264,9 @@ static void activate_action (GSimpleAction *action, GVariant *parameter, gpointer user_data) { const char *action_name = g_action_get_name (G_ACTION (action)); - if (STREQ (action_name, "reboot")) + if (STREQ (action_name, "shutdown")) + shutdown_clicked (NULL, user_data); + else if (STREQ (action_name, "reboot")) reboot_clicked (NULL, user_data); } #else @@ -2269,6 +2280,...
2006 Jun 27
5
Can''t call public application.rb method from ERb template
...for based on the current controller action. In my ERb template, I have <DIV class="<%= get_menu_display_style(''login_form'') %>"> In application.rb, I have the method get_menu_display_style defined as: public def get_menu_display_style(action_requested) action_name.eql(action_requested) ? ''left_nav_button_selected'' : ''left_nav_button'' end But when I go to my initial page, I get undefined method `get_menu_display_style'' for #<#<Class:0x37272b0>:0x3727220> I''m confused. I figured that I wou...
2006 Jan 02
2
Dynamic form tags
...extending it with model_name (some how)? I have several new_* methods (e.g. new_contact, new_company, new_project, etc), and I''m not going to bother with this challenge when you big guys out there tell me it''s a no go to develop this. def auto_form action = case controller.action_name when "new" then "create" when "edit" then "update" else controller.action_name end start_form_tag :controller => controller.controller_name, :action => action end Regards, Gerard -wanna be guru- P. -- "Who cares if it doesn...
2011 Sep 06
8
Ajax and rails 3 UJS (jquery)
Hi, guys, I''m in the midst of moving an app from rails 2.3.8 to rails 3.0.9. Sadly, rails 3 no longer has javascript generators and I''m now forced to do more javascript. For my project, I have selected jQuery as the javascript framework for my rails 3.0.9 app. What I have done to have my app''s deletion link (for each item) trigger an alert box when the deletion