Displaying 20 results from an estimated 9000 matches similar to: "using routes.rb from inside a controller / render_component_as_string / generally stumped"
2006 Jan 15
2
scaffold suddenly pluralizing names
I haven''t updated rails today and all of a sudden scaffold is
pluralizing my names
ruby script/generate scaffold Admin::Category
produces
class Admin::CategoriesController < ApplicationController
Do I really want "CategoriesController" instead of "CategoryController"?
Thanks,
Peter
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 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
2006 Aug 14
0
undefined method ''render_component_as_string'' - why?
I want to put a ''search_box'' text_field in the header of each page.
The search_box is implemented in a controller named ''users''.
(so Controller_A is calling a component in Controller_B)
When I add this line to my ''controllers/application.rb'' file, I don''t
understand why I get and ''undefined method'' error. After all,
2006 Jan 18
3
Documentation for scaffold / views
Apparently a scaffold creates at least one instance variable for views
to use, and if I override the scaffold then I must also explicitly
create that instance variable for the view. I''d like to know exactly
what work is performed by the scaffold so that I can know this when
over-riding the view. (OR, is it that the controller makes these
variables available by default?..)
EXAMPLE:
2006 Mar 16
4
calling an actionview method from inside a model
Hi,
I would like my model instance to produce it''s own list of options for
a form select. This is from a product model that has_many variations
def alts_for_select(current_id)
the_map = variations.map{|v| [v.name, v.id]}
options_for_select(the_map, current_id)
end
the model cannot see the options_for_select method
I tried to use
2006 Jul 07
5
Can a route require POST or GET? / REST problem with routing
Hi,
A store front a customer wants to GET /product/5/show. But for the
application this is really GET /cart_item/new/5 or even better
/cart_item/new?cart_item[product_id]=5
When the customer clicks add_to_cart they POST /product/5/show so that
the url doesn''t confuse the user when any validation errors occur. But
for the applicaiton this should be POST
2007 Jul 19
3
Merb::Controller#url Usage
I have a question about the usage of Merb::Controller#url. When I
have nested resources, requesting the new action works differently
than I expected. I was wondering what the intended usage is.
For example:
Say I have
r.resources :articles do |article|
article.resources :article_attachments
end
irb(main):002:0> show_routes
[:articles, "/articles"]
[:article_attachments,
2008 Feb 08
1
unwanted paragraph (syntax edge-case)
Hi list!
Take this markdown input:
* asdf
* asdf
* asdf
asdf
What I want:
<ul>
<li>asdf
<ul>
<li>asdf</li>
<li>asdf</li>
</ul>
<p>asdf</p></li>
</ul>
But markdown puts the first asdf into a paragraph. There is nothing I can do
2011 Mar 18
1
Bug using inline code blocks in nested lists?
Hi,
I am generating a nice document with some inline code blocks and came
around the following error:
1. asdf
- \` asdf `` `asdf` ``
produces:
<ol>
<li>asdf
<ul><li>` asdf <code><code>asdf</code></code> </li></ul></li>
</ol>
instead of:
<ol>
<li>asdf
<ul><li>` asdf
2008 Sep 17
2
bug in maruku with single-element nested unordered list?
This does not produce the expected output, yet does work on the dingus [1]:
* asdf
* asdf
>> require ''maruku''
=> true
>> doc = Maruku.new("* asdf\n * asdf\n")
=> md_el(:document,[
md_el(:ul,[md_el(:li_span,["asdf *
asdf"],{:want_my_paragraph=>false},[])],{},[])
],{},[])
>> doc.to_html
=> "<ul>\n<li>asdf *
2011 Jan 02
3
variable in loop
$ ASDF=hello; a=0; a=$(( 70 - $(echo $ASDF | awk '{print length}') )); echo "$a $ASDF"$(for i in {1..$a}; do printf "."; done)
65 hello.
$
Why doesn't it print:
65 hello.................................................................
What am i missing?
2010 Sep 15
7
Glassfish asadmin provider
Hi,
I am making a resource type to manage Glassfish domains. I''m not quite
sure how to specify provider commands with a sane default and in
configurable way. The location of the binary may be in other locations
depending on where Glassfish was installed.
http://github.com/larstobi/puppet-glassfish/blob/master/lib/puppet/provider/glassfish/asadmin.rb
Does anyone have any advice on
2011 Jan 05
2
check, that a script is in a folder
$ echo ${PWD##*/}
somefolder
$ if "${PWD##*/}" -eq "asdf" > /dev/null; then echo "this is the asdf folder"; else exit 1; fi
bash: notthatfolder: command not found...
this is the asdf folder
$
So i just want to check that i'm in an exact folder. e.g.: "asdf"
What's wrong with my one-liner?
I just want to check, that a script is in a folder,
2012 Jan 24
2
Password auth scheme question with mysql
Hi, I have a current auth database using mysql with a "password" column
in plain text. The config has "default_pass_scheme = PLAIN" specified
In preparation for a more adaptable system I changed a password entry
from "asdf" to "{PLAIN}asdf", but now auth fails. Works fine if I
change it back to just "asdf". (I don't believe it's a
2009 Jun 16
2
Question regarding dataframes, matrix, frame, etc...
Hi all,
As of now, I have a 15x8 matrix (name is "asdf"). The first seven columns
contain numbers while the last column contains a string. The class of each
column is "character". When I use the plot function to display a scatter
plot between any of the two columns, ie. plot(asdf[, 1], asdf[, 2])
everything works fine. However, if I want to use the command "pairs" to
2007 May 18
1
naive question about using an object as the name of another object
This is a dumb question, but I'm having trouble finding the answer to this.
I'd like to do the following:
x<-"asdf"
and then have
the object x.y become automatically converted/represented as asdf.y (sort of
akin to macro variables in SAS where you would do:
%let x=asdf and do &x..y)
What is the syntax for having x represented as "asdf" in x.y ?
Thanks,
2006 Jan 19
7
validates_numericality_of positive integer
Hi,
What is the simplest way to validate a positive integer?
validates_numericality_of :foo, :integer_only => true
how do I add the positive part? Do I need another validation statement
for pattern matching or do I have to write a validate() funciton for
my model?
Thanks,
Peter
2017 Jun 22
4
Question
Hi,
I am using Spark and the Sparklyr library in R.
I have a file with several lines. For example
A B C
awer.ttp.net Code 554
abcd.ttp.net Code 747
asdf.ttp.net Part 554
xyz.ttp.net Part 747
I want to split just column A of the table and I want a new row added to the table D, with values awe, abcd, asdf, and xyz. I am trying to use a command in
2008 Feb 13
1
acl, no rights and possibility to delete files
Hello,
I've a samba 3.0.24 and a share in ext3 with acl.
I've set on a file the following permissions on a file a.txt :
vssamba:/# getfacl /mnt/samba/partage/a.txt
getfacl: Removing leading '/' from absolute path names
# file: mnt/samba/partage/a.txt
# owner: herve
# group: users
user::rwx
group::r--
other::r--
The rights for share "Partage" are :
[partage]