Displaying 20 results from an estimated 200 matches similar to: "Re: help with link_to_if, I can''t make it work.."
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
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/.
--~--~---------~--~----~------------~-------~--~----~
You received
2006 Feb 11
6
models and validation problem
In my model, I am attempting to correct some bad data rather than just
pass an error message back to the user. The problem is that my fix
seems to get the data past validation but it then puts the bad data into
the database rather than the new(and improved) data. If I pass in
web_site with the value of ''www.test.com'', it will pass validation but
it won''t add
2006 Jan 04
1
Autocomplete howto?
On 3 Jan 2006, at 20:00, rails-request@lists.rubyonrails.org wrote:
>def auto_complete_for_dealing_which_store
> search = params[:dealing][:which_store]
> @stores = Dealing.search(search) unless search.blank?
> render :partial => ''live_search''
>end
>
>and my entire partial:
><ul class="autocomplete_list">
><% for
2006 Feb 10
3
Lighttpd segfaults on first access
I just got a new Debian Sarge server and followed the brainspl.at
"Debian Lighttpd Rails Stack" tutorial.
The only place I deviated was the version of Lighty. The page uses
1.4.7 and I spotted that 1.4.10 was available. I installed that and
couldn''t get anywhere. Lighty died on first access from the test
rails app, and even from a ultra basic static config. No log,
2006 May 23
1
How do I check if something was eagerly loaded?
I''m looking for a way to check an item in memory to see if an
association loaded. I load the association in the controller and then
in the view I need to check to see if the associated model loaded
because I display an attribute of it. Of course, if the model didn''t
load, because it doesn''t exist, I get an error. For example, in my
controller I have thus:
2006 Feb 12
0
Repost: brainspl.at tutorial and lighttpd .10 crashes
I just got a new Debian Sarge server and followed the brainspl.at
"Debian Lighttpd Rails Stack" tutorial.
The only place I deviated was the version of Lighty. The page uses
1.4.7 and I spotted that 1.4.10 was available. I installed that and
couldn''t get anywhere. Lighty died on first access from the test
rails app, and even from a ultra basic static config. No log, no
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
2006 Apr 08
2
trouble expiring cached pages
I''m having a bear of a time getting my cached pages to expire. Maybe
one of you guys can help me out. I''ll show my sweeper and then my log
to show that it "should" be working.
class PragmaticSweeper < ActionController::Caching::Sweeper
observe Comment
def after_save(comment)
expire_page(comment.post_id)
end
private
def expire_page(post_id)
2006 Jan 06
3
Countries -> Cities Select box
I am trying to play with a Countries -> Cities dynamically updating select
box.that is if someone selects a country then all the cities of that
country must be listed.Does anyone know of any data source for this?
I searched for it but couldnt find any good usable source.
Better still is there a module which I can mixin for this?
Thanks
Vivek
-------------- next part --------------
An HTML
2013 Mar 07
2
Puppet Dashboard changed reports view error
Hello Puppet Users !
We encounter a problem with the dashboard on this URI : /reports/changed
The /reports works fine with ~130000 reports (up to 3 months and
auto-cleaning with rake reports:prune job)
I make a reports:prune:orphaned, juste in case, but without any success.
The most recent change on the server was the puppetmaster upgrade from
3.0.2 to 3.1.0.
Here is the dashboard error log
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 =>
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 Jun 06
5
[OT] O''Reilly Cookbooks
Hi,
Has anyone gotten the "roughcuts" of the Ruby and Rails cookbooks? If you have the Pragmattic Rails Cookbook is the O''Reilly worth it? Also can you download PDF''s of their "roughcuts". The website is kind of vague, it just mentions online access (whatever that means).
Thanks in advance.
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
2006 Jan 05
0
nooby Q--default page for RoR changed?!
hi,
simple issue i''m sure--i''m a ruby & rails nooby--but for some reason the
sample app that i''ve been running/building from the Agile Web Dev w/
Rails book changed from a (nicely) formatted HTML page, with a link that
would try to show my application status, to the text i list below--with
the first line in larger typeface than the rest, but otherwise plain
2006 Jul 10
3
Can migrations set up foreign key references?
I use Oracle and i really want to use migrations, but there seems to be
no way to setup foreign key constraints. Is this true? If it is then
doesn''t that make migrations useles with Oracle?
Thanks
Chris
--
Posted via http://www.ruby-forum.com/.
2006 Jan 05
2
has_many - when are child objects created?
I has several model objects that flow down like a tree:
Class1 has_many Class2
Class2 has_many Class3
and so on.
when are the child records actually created?
If I do:
c1 = Class1.find(:all)
are the child objects (C2s below) created then or not until i do something like:
c2s = c1.C2s while iterating through the c1s?
If the form, that''s cool, no problem, but If I''ve got
2008 Mar 16
5
NOOB ISSUES!@%%#@#%@%^@
HELLO EVERYONE!!!,,im rather new at WINE, and i have a couple of programs i would like to RUN with WINE, but i kinda don't understand if there is a specific way to install a program for it to run on wine,,or even running the program itself,,i tried Installing NATURAL MOTION ENDORPHIN and i click on the short cut to open with wine, the Title menu comes out but nothing after,,i also tried