Displaying 12 results from an estimated 12 matches for "link_to_if".
2006 Jan 04
5
help with link_to_if, I can''t make it work...
For the life of me I can''t get it to work. Here is an example of my
syntax. I''m trying to make comment.name a link to comment.web_site only
if there is a comment.web_site. Can someone please help?
<%= link_to_if(comment.web_site.length > 0, comment.name,
comment.web_site {"class" => "comment_by"}) %>
--
Posted via http://www.ruby-forum.com/.
2008 Mar 24
8
Proper idom for link_to_if
What I wish to do is to have a construct like this in a view:
<%= link_to_if <some test>, "New Model View", new_model_path -%>
<some test> has to return true if new_model_path is defined and false
otherwise. What is the proper idiom to do this in rails 2?
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~-...
2006 Jan 05
0
Re: help with link_to_if, I can''t make it work..
...{"class... ?
Looks like there should be 4 params...test, text, href and html_params
A.
On 4 Jan 2006, at 04:42, rails-request@lists.rubyonrails.org wrote:
> Date: Wed, 4 Jan 2006 05:05:39 +0100
> From: charlie bowman <cbowmanschool@yahoo.com>
> Subject: [Rails] Re: help with link_to_if, I can''t make it work...
> To: rails@lists.rubyonrails.org
> Message-ID: <3b2a53e1cd0cc426350c06ff42fa5c3c@ruby-forum.com>
> Content-Type: text/plain; charset=utf-8
>
> has anyone else tried to use link_to_if?
>
>
> charlie bowman wrote:
>> For the life...
2006 Jan 09
3
Scaffolding - disabling Create, Edit, Destroy for some user logins?
People,
I am using:
before_filter :login_required
in my Controllers and this works fine. For some tables I am happy to
use the output of eg:
ruby script/generate scaffold Author
but is there some way that I can disable Create, Edit, Destroy for some
user logins in the corresponding view?
Thanks,
Phil.
--
Philip Rhoades
Pricom Pty Limited (ACN 003 252 275 ABN 91 003 252 275)
GPO Box
2005 Dec 15
6
Navigation menu
I have a navigation menu that contains a link per controller in my
application.
This menu is the same for all controllers, but I want this behaviour:
<a>Users</a>
<span>Statistics</span>
and
<span>Users</span>
<a>Statistics</a>
depending on the page you''re currently on.
I''ve put a <render :partial =>
2011 Apr 13
5
Nested route with collection
Hi!
I try to do nested route with collection, but I always have mistake
route:
resources :user do
resources :todo do
member do
post :complete
end
collection do
get :completed
end
resources :post
end
end
View:
<%= link_to_if (params[:action] == ''home''), ''Done'',
comoleted_user_todo_path %>
Browser back me mistake
undefined local variable or method `long_product_category_path'' for
#<#<class:0x1036ed8c8>:0x1036e92a0 </class:0x1036ed8c8>
Could you help
--
Y...
2006 Feb 05
6
render partial -- show certain content only if...
i''m working on a _post.rhtml partial, and it displays one blog post.
i''m accessing this partial on the list.rhtml and the show.rhtml
what i''d like is to only show the "link" link on the list.rhtml and not
on the show page.
<%= post.title%>
<br />
<%= post.body%>
<%= link_to
2006 May 23
1
How do I check if something was eagerly loaded?
...load, because it doesn''t exist, I get an error. For example, in my
controller I have thus:
def list
@systems = System.find(:all, :order => ''name'', :include => :review)
end
:review belongs to a :system, which has_one :review
In my view I do this:
<%= link_to_if !system.review.blank?, system.name, :action => ''edit'',
:id => system.review %>
This doesn''t work, because it queries the database each time (I''m
looping through a collection of 200 items). So my question is, how can
I get the link_to_if to check...
2006 Jan 11
5
stack level too deep problem
Hi all, I''m trying to overload the link_to function, (to disable link_to if
the user has no access right)
this is my code, it work the first time I run the application, the second
time I refresh the page I always get "stack level too deep error"
module UsersHelper
include ActionView::Helpers::UrlHelper
alias_method :link_to_original, :link_to
def permission?
true
2013 Mar 07
2
Puppet Dashboard changed reports view error
...itional parameters for this route.
content_url has the following required parameters: ["nodes", :id] - are
they all satisfied?) on line #35 of
app/views/reports/_reports_table.html.haml:
32: %td= link_to h(report.time), report
33: - unless node
34: %td= link_to_if report.node, h(report.host),
node_path(report.node)
35: %td= report.total_resources.to_i
36: %td= report.failed_resources.to_i
37: %td= report.changed_resources.to_i
38: %td= report.unchanged_resources.to_i
(eval):17:in `node_path''
app/vi...
2005 Dec 22
2
ACL Navigation Links
I''m currently using the ACL (Access Control Lists) system in my app.
The access control is working great, but I''d like to use the
permissions/roles setup in the database to hide links to areas a user
may not have access for automatically. I''m guessing that you could
setup a helper function to use instead of link_to and have it check
the permissions, but
2008 Jun 15
11
[PATCH] helper to create fb css stylized table
I attached a rails helper implementation of the fb_table described here:
http://wiki.developers.facebook.com/index.php/Facebook_Styles
I included testing and comments. I hope you find it useful.
Curiously, it''s really a small extension of FBML.
Richard
-------------- next part --------------
Index: test/rails_integration_test.rb