Displaying 20 results from an estimated 60000 matches similar to: "partials with action methods?"
2006 Mar 23
1
can befor_filter expect other controller''s action?
i put
befor_filter :setup_user,:except=>:login
in ApplicationController.rb
but i want to put action login to other controller
how can i do it?
does rails has this support?
befor_filter
:setup_user,:except=>{{controller=>''user'',action=>''login''},...}
--
Posted via http://www.ruby-forum.com/.
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
2006 Feb 19
2
instance variables in components not read by component view?
Hi,
I''m trying to write a sidebar menu with dynamic menus, and to do so I
would like to define a list of menus to display within my sidebar
component controller code and pass that list to the component display
view, like so:
# menu_controller.rb
class Sidebar::MenuController < ActionController::Base
uses_component_template_root
@menus = %w{admin user help}
def display
2006 Mar 24
3
Changing sidebar in layout per controller
I am currently using 2 layouts in my site. One is for the admin area. I
am trying to get content in my sidebar to change depending upon the
current controller.
Example:
Within admin I have a users controller and a articles controller. When
in the users view I want the sidebar to display options (like add user
delete user etc).
What is the best actionview way to do this. I don''t
2006 Mar 08
1
Components calling components...
Hi,
I''m relatively new to ruby and rails. I would like to have a sidebar
component call one of several other constituent components.
I''ve run into some problems, and so I''ve pruned things back to a
relatively simple case.
I have a sidebar component. Renders great. In it''s layout, I call
render_component for another component I would like in the sidebar.
2006 Jun 29
2
? concerning ActiveRecord, Action and template
Much appreciate any help here. I''m just getting started learning RoR and
setting up my first form is throwing me - I''m not getting the concepts
formalized in my mind.
Situation:
- Controller is: Donation
- Action is: donation_entry
- Template is: donation_entry.rhtml
This form will be displayed when selected from sidebar menu (which will
always be present for all
2006 Mar 28
1
Simple Sidebar Solutions: How does yours work?
I''m working on a simple photo gallery app for personal use and I want to
generalize the sidebar such that in any page (controller or view, I''m
not sure which) I can dynamically add either
1. links to a given sidebar
2. or an entire sidebar.
I know that typo does this, and I''ve looked the code. I think it''s too
complex a solution for my simple site.
2006 May 21
2
Nooby partials / component problems
I''m stumped on what seems like should be a fairly easy thing, so I
hope someone can point out my error.
I wanted to show a few things on every page, so I added an
application level template in "layouts". I added my styles in there,
and put the controller name and action name into the TITLE tag for my
own reference. So far so good - works like expected. Then I wanted to
2008 Oct 16
1
Modularisation: Using helper generating HTML output vs. using partials
Hey,
I''ve got a general question: when do I use helper and when I do use
partials to modularise certain gui elements?
For example: I''ve got a faq list. Each item can be folded and unfolded
using ajax.
FAQ foo
-> question 1
-> question 2
-> question 3
So, I wrote a helper "faq_li_tag(args)" which takes the question and
answer for parameters and generates the
2006 Jul 13
8
Acts As Authenticated - smarter login box
Hi,
I''ve got AAA loaded and working. I now want to put a smarter login form
on the sidebar of my site.
If the user is not logged in, I''d like to display a typical form in the
sidebar that collects the user ID/password and allows the user to login.
If the user is logged in, the box should display something like ''Logged
in user: FirstName Lastname'' and a
2007 May 30
2
Depot - empty_cart with ajax
First of all id like to say hi to everyone from Argentina, im yet
another Depot first-timer.
Going through the example, i got to the point where my cart finally
runs Ajax-based. And there is a line where Dave says, after all the
job is done "You should see the cart in the sidebar update. And you
shouldn''t see your browser show any indication of reloading the page.
You''ve
2009 Mar 05
3
How to render :partials *before* the :action has finished ?
Hi there,
I''m sure a lot of you guys have come across this question:
How can we render several :partials on a page *before* the called
:action has finished?
Basically, my situation is this:
When I click on a certain button, 3 things are supposed to happen:
- INSTANTLY: the button should become disabled (either by setting
":disabled" to "true" by updating the
2006 Apr 28
4
can someone help DRY a noob? thanks...
hi all
i''m trying to pass a variable name right round the block and need a hand
to ease my aching brain.
##in my sidebar i have
<li><%= SidebarItem(''catalogue'') %></li>
<li><%= SidebarItem(''provenance'') %></li>
<li><%= SidebarItem(''status'') %></li>
##linked to a
2006 Feb 18
5
Model methods and partial view templates
I have a method in a controller that invokes a
render :partial => ''some_partial_view''
In that view, I''m trying to access a method defined in a model, like
this;
<% for view in @an_array %>
<% local_var = view.some_method() %>
<% another_var = view.a_column_name %>
etc..
I am getting an undefined method error but the model is accessible
2011 Sep 01
2
Partial Page update and related combobox
hello,
I am doing a rails project and i am new to rails, am stuck
with some problems.
1) I have a div container at the left side of the page just like
a sidebar which contains different links. And the right side of the page
is meant to display the content, which is also a div container . When i
click any of the links in the sidebar respective pages must be displayed
in the right
2006 Feb 27
1
@content_for_sidebar?
Okay, I see this instance variable places, but I can not determine if it is real
or where the content comes from. I''ve tried views/<controller>/sidebar.rhtml,
_sidebar.rhtml, views/layouts/sidebar.rhtml and views/layouts/_sidebar.rhtml.
Does this actually exist? What''s the Rails Way to make a good sidebar?
http://www.google.com/search?q=content_for_sidebar
Thanks,
2006 Feb 21
1
formhelper methods don''t work with render collection partials
I''m rendering a partial using a collection:
<%=render(:partial=> ''record'', :collection => @records)%>
Inside the partial, I''m attempting to create a new form for each row,
generating elements like the following example:
<%= text_field "record", "name" %>
However, though my objects are fully populated, these form tags
2006 Aug 11
5
Why does no one like render_component?
Maybe I''m missing the point?
Lets take for example albums of pictures. If I have a scaffold for
each, and I''m showing an album, what if I want to list all of the
pictures that are in the album?
Surely, I''d want to call the List action in the picture controller.
render_component would do this perfectly. But we''re told not to use
render_component. So
2006 Apr 08
0
Typo and Instant Rails 1.2
Instant Rails is at 1.2 and I have installed Typo SVN Revsion 1000.
The sidebar changes stall with the spinner running even after the
*publish* button is clicked. The changes, themselves, do appear in the
actual blog.
When the *Sort Alphabetically* is clicked under categories an error
occurrred. I changed the code as follows:
2006 Mar 21
1
What is the difference between render partial and component?
What is the difference between the render(:partial => ''article'') and
render_component?
--
Posted via http://www.ruby-forum.com/.