Displaying 20 results from an estimated 40000 matches similar to: "problem with elsif"
2006 Aug 03
3
helpers: newbie problem
please help me with my code:
im calling a helper, which has to return different links.
--list.rhtml
...
<% for message in @messages %>
<tr>
<td><%= message.author.send(''name'') %></td>
<td><%= message.send(''date'').strftime("%d.%m.%y/%H.%M.%S") %></td>
<td><%=
2006 Jul 24
3
administration tutorial
hi!
im learning how to work with sessions. i made a prretty simple login
system, but i havent found a good tutorial to make a login system with
permissions (admin can delete,edit,etc) other users only read, edit, etc
do u know where can i find some info/tutorial about that?
ty!!
--
Posted via http://www.ruby-forum.com/.
2008 May 28
15
Help with output
I am having problems trying to get the output to work in an
application I have. Here is the example
THIS GIVES ME THE CORRECT VALUES
<!-- ######## Flooring ######### -->
<% if(params[:flooring]) %>
<tr><td colspan="4"><h2>Flooring</h2></td></tr>
<% for company in @companies
2006 Jan 31
6
Pagination - why is it this hard?
Hi everyone,
I''m at the end of my rope on this. I can''t get pagination to work
with anything but a standard find on a model. If I try to do a search
and customize the pagination, I get lots of different variations.
My thought was to have the list action do what it does, but to pass it
a list of search conditions from the search action. So, if search
determines that we need
2008 Jul 04
3
Linkt_to problems
I can''t explain where those differences come from.
In one Project I can use the link_to without any problems.
Like this:
<%= link_to "LINKNAME", :action => "destroy", :id => ID %>
But in another project... That happens
<%= link_to "delete", :action => "destroy", :id => ticket.id %>
<%= link_to "edit", :action
2006 Apr 28
9
[AWDR] Tutorial in A4 wont ''destroy'' items
Hello,
I''m working through the tutorial, and I''ve run into a little snag. In
the first part of the tutorial, the destroy link is not working
correctly. I can''t figure out where I goofed. Removing :confirm doesn''t
seem to resolve the issue.
Thanks,
Randy.
development.log
----->8-----
Processing AdminController#destroy (for 127.0.0.1 at 2006-04-27
2006 Apr 09
4
Best RJS process for what I''m trying to do...
I just wanted to ping this off the list to get some advice since I''m
now pulling my hair out. Thanks in advance for taking any time to look
at this. It''s much appreciated. Now, my problem is my RJS is working
but it''s not inserting how I want it to insert. I have a partial I''m
rendering in my view that looks like this:
<ul
2008 Feb 29
3
How to DRY REST admin path in URLs?
Hi everyone...
For almost all of my objects I put a series of classic REST admin links
in views. For example, for a ''user'', I have
<%= link_to "Show", user_path(user) %>
<%= link_to "Edit", edit_user_path(user) %>
<%= link_to "Destroy", user_path(user), :confirm => "Are you sure",
:method => :delete %>
I am tired
2007 Nov 28
3
overriding rest show route but not delete
hi, lets say routes.rb has
map.resources :foo
and I want the show action to have a diffent url, so I add (after the
above line)
map.foo ''/bar/:id'', :controller => ''foo'', :action => ''show''
this works fine, including foo_path( :id => "1") => /bar/1
and <%= link_to ''Show'', foo %>
2011 Feb 12
5
link_to a action in the controlles is not called
i have a link where it has to call a method defin in todoscontroller
named say_when but show is called
<td><%= link_to ''Say when'', todo, :action => :say_when ,
:remote => true %></td>
class TodosController < ApplicationController
# GET /todos
# GET /todos.xml
def index
@todos = Todo.all
respond_to do |format|
format.html #
2006 Jan 08
4
scaffold uses link_to for destroy
Hi,
I wonder why scaffolding uses a link_to tag for the destroy links.
Seems like these should be POST requests with button_to. The Rails
book dedicates pages 335-337 to this very issue.
Peter
2006 Mar 18
3
Nil result on find & pretty print
I am new to Ruby and to Ruby on Rails and have spent the last few days
trying to get my head around it. I think I am already hooked but am
suffering badly from years of programming a non-OO RDBMS. I am trying
to learn by attempting to produce a system for my work.
I have a main table sdocs which has a field supplier_id which is an
entry in another table (suppliers) to lookup supplier name etc.
2006 Jul 07
8
Possible name clash?
Scenario:
Table in database has two fields, id and category (table name is:
categories)
Controller is named category_controller.rb
Model is named category.rb
Helper is named category_helper.rb
Form is named list.rhtml in view\category directory
The code in play on the form is (from generating scaffold):
<% for category in @categories %>
<tr>
<td><%=
2006 Jul 07
5
link_to: link is missing id
I''m using a legacy table, where the unique id is not ''id''
I have a Model class like the following:
class Article < ActiveRecord::Base
set_primary_key "ARTICLE_ID"
end
however, using a link_to like the following (modified scaffolding),
the link has no id value:
<% for article in @articles %>
<tr>
<% for column in
2006 Apr 20
5
Noobie problems with helper
I have the following helper method in application_helper.rb:
def format_date(date)
day = to_s(date.day)
month = to_s(date.month)
time = to_s(date.time)
date = day + "/" + month + " - " + time
return date
end
I am trying to call this method in a view like this:
<%= format_date(bounty.created_on) %>
create_on is a timestamp in mysql. I am
2011 Sep 06
8
Ajax and rails 3 UJS (jquery)
Hi, guys,
I''m in the midst of moving an app from rails 2.3.8 to rails 3.0.9.
Sadly, rails 3 no longer has javascript generators and I''m now forced
to do more javascript.
For my project, I have selected jQuery as the javascript framework for
my rails 3.0.9 app.
What I have done to have my app''s deletion link (for each item)
trigger an alert box when the deletion
2006 Jun 13
1
How to give conditions in rails
Hi, I have Holiday table. the fileds are id,holiday_date,description. i
added new records and list them also. when i listed all the records in
the database are listed but i want to list only one particular year
records. my holiday_list.rhtml page is as follows
<%= stylesheet_link_tag "common", :media => "all" %>
<%= error_messages_for ''holiday''
2012 Feb 12
3
Rails routes - destroy
Can''t figure out how duplicate routes are differentiated by rails ...
Read routing from inside out and API as well as a few tutorials but
still don''t get it!!! For example...
routes.rb
resources :minisections do
resources :questions
end
rake routes:
minisection_question GET
/minisections/:minisection_id/questions/:id(.:format)
questions#show
2008 Jan 21
7
undefined method error
Hello everyone,
I am following the Practical Rails: Social Networking
sites book. In chapter 7 photo gallery I am getting a
NoMethodError in Pages#show
Showing layouts/_menu.rhtml where line #12 raised:
undefined method `new_entry_path'' for #<ActionView::Base:0x52fa56c>
Extracted source (around line #12):
9: <% if is_logged_in? %>
10:
2010 Aug 12
10
Scaffolding working...kinda
Hello all. I''ve been working through some online tutorials, learning ROR
and have a question on scaffolding. Through the command promt i''ve ran
the command:
$ script/generate scaffold Albums
This created the controllers, helpers, models, and views.
I have a database table titled "albums" and have two records saved
within
The problem is that the scaffold command did