similar to: Return Rendering Controller In View

Displaying 20 results from an estimated 11000 matches similar to: "Return Rendering Controller In View"

2006 Jul 22
4
Accessing the controller name in your views?
I need to know what controller and action the user is currently in to do various things in my layouts/application.rhtml file. Isn''t there is a better way than: <% if params[:controller] == "whatever" && params[:action] == "whatever" %>some html<% end %> I know in the controllers you can just use controller_name, but that is not provided
2006 May 15
2
Retrieve the current controller name from a view
Hi all, I wonder if it''s possible to retrieve the current controller name and possibly the action when you''re in a view. i.e. I call the same template/partial view from different controllers and I''d like to know when I''m in the view code which controller is calling it... Any ideas? Sorry if it''s obvious but I couldn''t find it in the doc.
2004 Sep 29
2
RSXML - Parsing XML Documents on Internet
R Users - I asked about this a few months ago and never did quite figure it out, so with more information, allow me to try again. If I use the following code: library(xml) xmlTreeParse("http://home.comcast.net/~larsenmtl/xmlTestDoc.xml", isURL = TRUE) I receive this error: Error in xmlTreeParse("http://home.comcast.net/~larsenmtl/xmlTestDoc.xml"", : error in
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 Mar 10
1
Problem rendering components
I have an AccountsController that inherits from ApplicationController. In ApplicationController I define a generic layout. In this layout I render @title that is actually assigned in the AccountsController but has a default value in ApplicationController. In the layout template, I also have the standard contents_for_layout and lastly, I have a render_component. The component called from the
2006 Jul 22
3
How do you find out what action rendered a page
Hi I have this list page that has some rjs templates updating parts of it including a table of results. i''m trying to put pagination on the table. thing is lots of different actions update the table and they have their own paginators. anyway i have this code at the bottom which worked for another page <%= pagination_links_each(@offer_pages,:window_size =>4) do |n|
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
2006 Apr 11
4
wrong number of arguments (2 for 1)
Hi, Im having trouble figuring out how to query my database in ruby and i''m hoping someone can help me out. I''d like to find all my departments that match a permalink passed from the url. The department must also match a particular category, also passed through the url. I have written the following code. But unfortunatley I get an error "wrong number of arguments (2 for
2006 Jan 04
7
recongizing the current controller in views
alright i am doing a simple self blog in ruby. Now iw ant to be able to determine which controller action i am in inside _form.rhtml. So if i am in new or the creation control than i want to insert the text box for topics else i want to display the topic base on id. (i could do those already, i just need help finding the right if statement.. something like (if currentpage ==
2007 Jul 24
4
spec''ing helpers that use controller
Hi all, I''m in the process of creating rspecs for my helpers. One of the helpers in app/helpers/application_helper.rb looks like this: def page_name @page_name || "Define @page_name in #{controller.controller_name}::#{controller.action_name}" end The rspec is simply: it "should something" do page_name end
2006 Aug 12
7
Redirect back to last page?
I have a few pages where a user may do something (add tags, login, etc) and I would like to redirect them back to the last page they were at before calling that action. Is there an easy way to do this? -- Posted via http://www.ruby-forum.com/.
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
2006 Mar 22
4
Problem with ACL plugin system
Don''t know if anyone else has experienced this but I''m having a problem with the access_denied method in Ezra''s ACL access control plugin. It''s working fine (in conjunction with acts_as_authenticated) until it comes across a user it denies access to, in which case it throws the following error: NoMethodError in Admin#index protected method
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 =>
2008 May 11
3
Get current controller name/action name from view
Hi. I swear I found this in the group archives, but now I cannot find this in the group or elsewhere online! In a view I would like to get the current controller name and action that was used to get here. For example, I have a template that I''m using from two different controllers (and four different actions in each controller), such as :controller => "my_view", :action
2006 Apr 27
7
HTML Title
Hi there, If I have an application.rhtml template what''s the best way to set the contents of title element in the html -> head area of the template to something set in the view for action in a controller. I want to just have one template which renders the basic layout for all pages and I''ve been scratching my head over this one for a couple of hours now. Any help
2008 Dec 07
2
Strange 500 Error with namespace::controller#action appearing in reload only
The portion of the log linked below is two requests directly out of the log file for the same action. The first request was from me putting the address in the browser directly (but can be duplicated by linking to the url anywhere in the app). When I reload the browser on this url, I get a strange error. To the user, the action appears to load fine, but I''m getting a 500 error in the log
2006 Jan 29
4
current_page?()
Can someone give me a working example of current_page?(), because I''ve been trying to get this to work for a while now. I''ve been trying this: if current_page?(".*") @test = "asd" end but get a "undefined method `current_page?''" when I put it in my controller or application.rb. If I put it in my application_helper.rb, the page renders
2009 Mar 04
6
render yield?!
Hello, I''ve got a little problem with remote functions. I call it for example like this: <%= link_to_remote ''bla'', :url => ''bla/whatever'', :method => :get %> that function would be: def whatever flash[:notice] = "You''re in whatever!" update_content end since I don''t want the page to be reloaded completely,
2006 Jul 07
13
Rails Recipes Book: Authentication
Hi, The user/login management system in Chapter 31: Authenticating Your Users and Chapter 32: Authorizing Users with Roles of Chad Fowler''s Rails Recipes looks reasonable and adequate. However, when I ran the Chapter 31 code, I get the following error: Username or password invalid And I am not even given the chance to sign in; that is, the signin form does not appear at all. Has