Displaying 20 results from an estimated 1000 matches similar to: "Any way to pass state to a component?"
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
2006 May 24
22
Components going out of style?
I see in the new Agile Rails 2nd edition that components are going out
of style?
Is this so? has anybody abandoned the idea of components for helpers?
Specifically I''m considering a menu sytem for a website that depends
heavily on the users permissions to decide which menu options a user
would need to see. I thought that components, since they have the logic
in the controller and
2006 Aug 14
2
Undefined Method error for call to ''render_component_as_string''- Why?
I want to put a ''search_box'' text_field in the header of each page. This
common header template is implemented in ''views/layouts/application.rhtml''.
The search_box is implemented in a controller named ''users''.
(so ApplicationController is calling an :action in UserController)
When I add this line to my
2009 Jul 20
9
Upgrade server to run on Rails 2.3.2/F11
Note that one of the 8 patches (#6) will be sent separately in reply
to this email, as some of the replaced lines are too long, so git
won't let me send the email. However, there is nothing wrong with
that patch, and it should be applied in the sequence listed below.
Note also that I assume this will be tested on a clean f11 install, rather
than an upgrade of an existing ovirt server
2006 Mar 15
5
Passing params to a component
I see from http://rubyonrails.org/api/classes/ActionController/Components.html
that is possible to pass paramaters to a component.
I don''t understand the exact syntax.
I''m trying:
@master_id = @params[''master_id'']
in the components controller but it is not working.
==== Details:
In my calling view I have:
<%= h(@opportunity.id) %>
<div
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
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/.
2018 May 26
3
Grouping by 3 variable and renaming groups
ALCON
I'm trying to figure out how to rename groups in a data frame after groups
by selected variabels. I am using the dplyr library to group my data by 3
variables as follows
# group by lat (StoreX)/long (StoreY)
priceStore <- LapTopSales[,c(4,5,15,16)]
priceStore <- priceStore[complete.cases(priceStore), ] # keep only non NA
records
priceStore_Grps <- priceStore %>%
2018 May 26
0
Grouping by 3 variable and renaming groups
Hello,
See if this is it:
priceStore_Grps$StoreID <- paste("Store",
seq_len(nrow(priceStore_Grps)), sep = "_")
Hope this helps,
Rui Barradas
On 5/26/2018 2:03 PM, Jeff Reichman wrote:
> ALCON
>
>
>
> I'm trying to figure out how to rename groups in a data frame after groups
> by selected variabels. I am using the dplyr library to group my
2018 May 26
1
Grouping by 3 variable and renaming groups
Hello,
Sorry, but I think my first answer is wrong.
You probably want something along the lines of
sp <- split(priceStore_Grps, priceStore_Grps$StorePC)
res <- lapply(seq_along(sp), function(i){
sp[[i]]$StoreID <- paste("Store", i, sep = "_")
sp[[i]]
})
res <- do.call(rbind, res)
row.names(res) <- NULL
Hope this helps,
Rui Barradas
On 5/26/2018
2006 Feb 16
9
calling a controller/action from another controller
Hi,
Is there a way to call a controller/action pair from another controller
as well as render the view for that pair? I have tried using "render
''ctrl/action''" and that works, but the controller code isn''t called
(only the view is rendered). A redirect_to isn''t desirable either as I
want the resulting content to be rendered in the current
2006 Aug 31
1
Need architectural help avoiding render :component
I''m writing a CMS/portal system, and I''m having trouble coming up with
a way of routing requests that feels right without using render
:component (which I''ve read should never be used). The system works
like this:
Each user has a set of "pages" which are shown as navigation tabs on
the page. The user may rename, reorder, add, or delete pages for a
custom
2006 Jun 22
5
Problems with layouts
ruby script/generate controller Tools::Search - ok
in views/layouts/application.rhtml:
<%= render_component :controller => ''tools/search'',
:action => ''searchbox'',
:params => {:context =>
''header-section''}
%>
in
2006 Mar 18
16
fixrbconfig - does it work on intel macs?
I''m trying now to do "sudo fixrbconfig" in the terminal, and I get this:
/usr/lib/ruby/1.8/powerpc-darwin8.0/ruby.h does not exist. This
probably means you haven''t yet installed Xcode from the Tiger DVD. You
won''t be able to compile Ruby extensions without it. Please install it
then rerun this program.
I''m on an intel mac. Am I unable to use
2006 Jan 13
4
Flash not cleared with ActiveRecord session store
Cheers,
I''ve stumbled over a bug with 1.0 and ActiveRecord store for session
while migrating from pstore sessions.
I created the table with `rake create_sessions_table` and set
`config.action_controller.session_store = :active_record_store` in
environment.rb.
Everything runs fine except that the flash messages will not be cleared.
I get the same message everytime on everypage I
2006 Feb 04
22
What''s the best way to embed a form?
I would like to embed my login form on my app''s home page. What''s the best way to render the login action of member controller from another action?
Thanks
Frank
---------------------------------
Relax. Yahoo! Mail virus scanning helps detect nasty viruses!
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
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
2005 Jun 26
4
calling controller and caching from a sweeper class
[cross-posting to rails and typo lists]
Hi,
I''m tinkering with the code for typo, a rails-based blog engine.
Typo has an XmlController with actions "rss" and "atom" which generate feed.xml
files, and it uses a caches_page declaration to cache the files that get
generated by those actions. It also has a Sweeper (Observer) class that expires
those cached files when a
2006 Apr 10
4
has render_component changed?
I have an application that worked fine, but after the recent updates
has broken in some calls to render_component from views. I might be
missing something but as far as I remember Rails updates is the only
thing I''ve done in between. See the log:
*** START LOG SNIPPET
Start rendering component ({:params=>
{:center_id=>10, :id=>25},
2006 Feb 24
4
too many components?
okay.
on /posts/show/13
i have show.rhtml, which does
render_component(:controller=>''comments'', :action=>''display_comments'',
:id=>post.id)
on comments/display_comments
i iterate through the comments and then, display_comments.rhtml
render_component(:controller=>''comments'', :action=>''new'', :id=>@id)