similar to: DRY - with modules, render_component or.. ?

Displaying 20 results from an estimated 1000 matches similar to: "DRY - with modules, render_component or.. ?"

2006 Feb 27
3
Send parameter along with method in before_filter
Hello list, I have an app that has a very simple authorization scheme. A person can have many roles and roles can have many people. In my app, I''d like to do before_filter :login_required (since no role name is provided, it accepts any users with credentials) before_filter :login_required ("administrator") (only accepts those with role administrator) before_filter
2006 Mar 03
68
Agile Web Development with Rails 1.1
Dave, on another topic, might I recommend that you and DHH publish an updated version of the Agile guide right away when 1.1 comes out? You could reuse much of your material and it would do a lot of good to help make sure there is still a good centralized source of reference for Rails. Without that book, there really is not a good one-stop source of information for people to learn how to use
2011 Feb 21
2
self.prepend_view_path - am I missing something
I have an app that varies its content based upon the domain from which it is being accessed. Some of the domain characteristics are supported in the model but it is easier varying static text in the views and then sharing the form templates via partials etc. Rails 2.3.10 and looking at the documentation at
2003 Aug 24
2
GS on ebay...
101's for 68.00 http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=3042066051&category=11175 102's for 79.95 http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=3042066389&category=11175 Just passing what I find along.... bkw
2007 Dec 23
5
prepend_view_path not working
Now that controllers can have multiple view paths I''ve been playing with themes over the weekend. Running into a view issues. I have a before_filter in the ApplicationController that calls prepend_view_path to add the path of my theme. I even log the view_paths in an after_filter to make sure it made it all the way through. The output looks something like:
2006 Feb 13
1
another simple question: per_page in pagination
Hi, Why can''t I use a variable to specify the :per_page attribute when using the most basic form of pagination? (if I use a hardcode number, it runs) What did I do? Thx. My code: def list_orders page_size = 20 ... order_pages, @orders = paginate(:orders, :per_page => page_size) end My Errors: undefined method `>'' for false:FalseClass RAILS_ROOT:
2006 Apr 23
5
Controllers in folders and helper scope in Rails >1.0
Hi, Here''s my problem. I tried to google it, read the release-docs and haven''t found anything similar. My application uses folders to store controllers, as described in the Rails book. I need to have same-named controllers for admin and for users, so it looks like this: /app/controllers/admin/project_controller.rb /app/controllers/admin/...
2006 Jan 24
1
render_component and private access...
I was wondering if rails had any means of restricting access to an action in a controller (like they can''t type in url.com/cont/action, that would throw an error). The thing is I would like to be able to access this method/action through a call to render_component, so therefore, I don''t think private methods will work. So basically I am looking for something that cannot be
2006 Feb 08
1
render_component vs. render_component_as_string?
I''m calling render_component in a helper. render_component :controller => target_controller, :action => "show", :id => target_id This works fine, except that passing the id in :params didn''t work and I had to pass in an explicit :id parameter to get the target controller to override the id - is that documented anywhere? That''s not my question. My
2011 Feb 28
1
Problem with render_component and rails 3
I have a application that it use view/layout/application.rhtml, in this file I have: <%= render_component :controller => ''car'', :action =>''index''%> But there is one problem, it display this problem: undefined method `render_component'' for #<#<Class:0xb67e6e48>:0xb67e5f34> How can I resolve this problem? -- You received this
2006 May 26
1
flash.keep not working with render_component
Using Rails 1.1.2 and ruby 1.8.4 I''m having a weird issue with the flash when using render_component for an action inside different controller than the one from which you render. I''m passing an object via flash across a couple of actions (new and create) behind the scenes using flash.keep(:object). It works fine if the component I''m rendering is in the same
2006 Apr 13
1
Layouts in render_component?
Hi All, Silly newb question. Is there a reason why :layout is unimplemented in render_component() ? I''m looking at a situation where that would *seem* to be the right answer. Are there any patches available to add this? JK
2006 Feb 01
1
detecting whether a request comes from render_component
Hi All, Anyone know if there is a way to detect whether a request came from a render_component call? There isn''t anything obvious from looking at the source, but it would be useful as I have set up a logging filter in my application.rb, and I''d prefer to exclude all component renders, since they just add extra lines to my log (I guess I could exclude identical rows at the db
2006 May 07
0
caches_action and render_component
I''ve made some test: ------------------ CODE ------------------ class FooController < ActionController::Base caches_action :foo def foo render_text ''Hello, foo<br />'' end end class BarController < ActionController::Base def bar render :inline => <<-EOS Hello, bar <br /> <%= render_component(:controller =>
2006 Mar 14
0
how to render_component in global layout
Hello, i have one layout file for all controllers. I would like to have news list on each page. So, i put <%= render_component :controller => "news", :action => "list" %> , to my layout file. But this doesn''t work at all. I get error "Application could not be started.. ". If I put render_component to some view file say
2011 Dec 12
0
<%= render_component %> Tag cloud issue for rails version 2.3.11
hi all, in my application there is tag''s cloud in old code which is load using following code <%= render_component :controller => "controller_name", :action => "tag_cloud_homepage"%> now i upgrade the ruby,gem and rails version to Ruby :1.8.7 Rails :2.3.11 gem :1.6.2 and i am using Windows XP as O.S my question, now in Rails 2.3.11 "<%=
2006 Sep 12
2
Cache sweeping and render_component (my mistake or Rails bug?)
Hi I''m working on a program which relies on heavy cache sweeper usage. I''ve just bumped onto an odd problem. When using render_component method in layouts or templates with cache sweeping turned on, Rails throws an exception with the following message: NoMethodError in TestController#index You have a nil object when you didn''t expect it! The error occured while
2006 Apr 21
1
render_component includes layout
I have dynamically generated list of links that I wish to include in different views, I''m using render_component to do this but it is also including the layout. How do I turn layout off on a per action basis? Many thanks, K. -- Posted via http://www.ruby-forum.com/.
2006 Mar 03
0
render_component in application.rhtml
I''m using application.rhtml as the common layout for all controllers in my app. I want to add navigation links inside the header portion of each page and this section is in the application layout (application.rhtml). The navigation links also include inforation like username and a link to logout if the user is logged in, or link to login...standard stuff. Anyway, i have controller
2006 Jan 13
0
Layout not rendered when render_component used
Hi I''ve got a login action that handles authenticating users, setting cookies and, via its view, displaying an HTML snippet containing a form with username and password fields. It''s called from the main application.rhtml layout so I don''t need to have a seperate page (away from the main site) with a login form. My user model is more-or-less the same as in the Agile RoR