Displaying 20 results from an estimated 10000 matches similar to: "quick link_to question"
2006 Aug 10
2
rendering templates from an engine''s app dir
Hi there,
i have a rails application which use the active_rbac engine for user
and access control.
How can I use the original login, etc. forms which were provided with
the engine as partials in my application? I''ve tried all of the below
mentioned approaches and it seems so that I cannot reach the templates
provided under the [RAILS_HOME]/vendor/plugins/active_rbac/app/views
directory.
2007 Oct 26
5
specing rescue, ensure and else blocks of an Exception
Greetings,
I''m using rspec with rcov for my applications and there is one issue
which I cannot solve nor can find any proper information regarding
it: specing what is in a rescue block in case of an exception.
I''m using Ruby on Rails and I usually make use of exceptions in my
controllers, like the following example:
def action
@foo = Foo.find(1)
2007 Oct 26
7
Weird failing spec
Hi guys,
I have a weird failing spec, for which I just cannot figure out the
reason of failure. I''m now rewriting my controller specs based on the
advice of David and Ashley, and I got stuck on this (see: [rspec-
users] specing rescue, ensure and else blocks of an Exception).
http://pastie.caboo.se/111221
I''ve tried everything, like stubbing out :update_attributes! , even
2007 Sep 06
3
no build! on association?
Hi guys,
it seems like I missed some trivial stuff going on in edge rails. Can
you point me in the right direction about what happened to the build!
method?
Simple scenario:
class User << AR
has_many :posts
end
class Post
belongs_to :user
end
console:
>> u = User.find(1)
>> u.posts
[]
>> u.posts.create!({:title => "Foo", :content =>
2006 Nov 04
2
strange errors in dev.log and webserver log
Hi guys,
I have encountered a strange error in one of my applications.
The details are the following:
The application is a very simple one, I have one model, Cards, it has
some pretty basic stuff, some after_save methods for saving uploaded
files to their places.
I have an UI where I can manage the Card records, with the default
methods, including ''edit''
cards_controller.rb:
2006 Aug 10
6
Partials - asked before never got reply
I''m trying to figure out how multiple partials in one page would be
configured when they are based on some action in the controller.
As an example -
I have a main/welcome page. If someone new or a user not logged in
arrives at this page I display both a registration form and a login
form. However, if they are logged in then those forms should not show
up on that page. Also should
2006 Apr 06
2
Quick Question: Using a CSS class statement in a link_to tag
Hi,
I have a css file with lots of classes. I want different links on my
page (which all use the ''link_to'' tag) to belong to different classes so
that I can format their font, size, color, etc.
Where or how do I use the css class name in the link_to tag?
Thank you very much
--
Posted via http://www.ruby-forum.com/.
2006 Apr 01
3
Quick question about <% link_to something, :action => ...
Hi,
I have a basic question. when i use
<% link_to show_city,
:action => ''my defined action''
:id => ''something'' %>
//what is ID here? is this the parameter in my mysql db?
basically
how can i put a parameter into the link that when it hits my function,
it can tell my function what to use as a condition to search. for
example i have a table of
2006 Mar 20
9
jEdit Snippets for Ruby on Rails
-----------------------------------------------------
Announcing: jEdit Snippets for Ruby on Rails
-----------------------------------------------------
I thought I''d "give a little back to the community" and whip up some
SuperAbbrev files for ruby and rhtml that mimic all of the Textmate
Rails bundle snippets.
Note: This was totally inspired by Textmate and the syncPEOPLE
2006 Jun 07
2
Hash flattening on paginator link_to
Hey
I need some help with pagination and the link_to in the view.
I''m trying to include a hash in the pagination link_to params and it
keeps flattening out my hash.
Example:
Here''s my hash called @answer:
"answer"=>{"6"=>"9bf31c7ff062936a96d3c8bd1f8f2ff3",
"7"=>"6f4922f45568161a8cdf4ad2299f6d23"}
2008 Jan 03
3
how to use "link_to" to deliver a parameter?
Hello, there:
I wish A link to invoke such a action together with the parameter
"zh_CN" "cookies/switch_language/zh_CH" to switch language
sellection, and I use the following code:
<%= link_to ''Chinese'', :controller => ''cookies'', :action =>
''switch_lang'' %>
But, how is "link_to" able to convey
2008 Oct 17
1
link_to + image_tag
i want to integrated link_to with image_tag
before i did link_to with image_tag like this
<%=link_to image_tag(image.filename
2006 May 24
1
link_to CSS problem
Hi all,
I''m a Ruby/Rails/web development newbie, so this may be a stupid
question. I''m putting some links using link_to into my rhtml page,
creating the layout using the DIV tag:
<div id="description">
<%= link_to h (item.description), :action => ''show'', :id => item.id
%>
</div>
...
div#description {
float: left;
2007 Dec 06
2
passing parameters through link_to
Is it possible to pass parameters through link_to that will be used by
the controller that link_to directs to? Specifically I have this
code:
<% for user in @users -%>
<%= link_to user.screen_name, {:action => "index", :controller =>
"users", :user_id => user.id } %>
<% end %>
Is it possible to use the parameter at the end of link_to(:user_id
2007 Nov 14
3
absolute urls in url_for vs. link_to
In both url_for and link_to, the :only_path param can be used to
determine whether the link url used is complete with hostname and path,
or just has the path (a kind of relative url).
However, in url_for it defaults to false (urls with hostnames), and in
link_to it defaults to true ( urls without hostnames, just paths).
Is there any reason for this discrepency? To me, it violates the
principle
2006 Jun 09
5
Using link_to with an image tag & link text
Hi ,
I was trying to use link_to along with image_tag
to setup a link that would open in an external window.
But I was unable to make a link using both text & an image
So my current workaround looks like this inside a partial
where link is http://foo.com & text would be descriptive
<img src="images/arrow.gif" border="0"/> <%= link_to(text, link,
:popup
2006 May 11
3
can''t call link_to from within a model class
can anyone tell me how to call link_to from within a model class? I''m
trying to do something like the following:
validates_uniqueness_of :email, :message => "address has already
been taken. If you''ve forgotten your password, please click " +
link_to(''here'', :action => ''forgot_password'', :controller =>
2013 Mar 15
5
link_to should have its body and url arguments reversed
I think the link_to helper method is quite confusing with its arguments
order:
link_to body, url
link_to "Click me", @person
Why is it thay way round? I want to make a "link to [the] person", so I
would expect the order to be:
link_to @person, "Click me"
It reads much more natural. You don''t "link to [the] body", you "link to
2006 Jun 04
3
link_to tool tips
I think they are called tool tips...
I have view code that looks like this...
<%= link_to ''I'', :action => ''edit_innoculations'', :id => personnel %>
Is there an option (I don''t see it in api) to have tool tips for a
link_to ?
Craig
2006 Jun 20
4
Invoking MouseOver using link_to tag ?
Hi,
How can we trigger a JavaScript built in function from a <%= link_to %>
ie. i have the below statement in my view. I want to invoke a JavaScript
function on "MouseOver" of this below text (''TestingMouseOverEvents'').
<%= link_to "TestingMouseOverEvents" , :controller => "login", :action
=> "logout"%>
Note: The