Displaying 20 results from an estimated 10000 matches similar to: "redirect after validation"
2006 Feb 23
12
how to output something from within <% %> tags?
simple question: how do I output something from within <% %> tags? e.g.
like ''echo'' in PHP. I thought it would be ''puts'' or ''print'' but neither
seems to work. right now I always close the %> and open a <%= which is
tedious.
--
Posted via http://www.ruby-forum.com/.
2006 Mar 02
3
How to identify the browser?
I need to generate some browser-specific code; can I identify which
browser is being used from within my RoR code?
--
Posted via http://www.ruby-forum.com/.
2006 Feb 21
5
how to include an html file?
I have a bunch of html files with partial page content. I''d like to be
able to include the content of these files in my RoR views without
having to change or rename them.
In PHP I''d simply use
include("file.html");
What is the RoR equivalent of this? render_file insists on it being an
rhtml template, and render_partial requires me to rename the file.
Ideally, I
2006 Mar 02
1
Forms with and without Models and Error Handling
Hi,
I currently programming a delicious clone to understand ruby on rails.
The problem I''ve got is that I prefill a form (form without models)
without a database connection and then save it into the database.
For validation i am using the validation helper methods. My Problem is
that i don''t know how I get the error hash from the helper method
validates... etc. because I
2006 Feb 23
7
How to set a relationship with a value from a selection list
I realize this is probably a very basic problem but I''m developing my
first rails app and running into this problem.
I''m trying to write a photoblog application. I have a photo table and an
album table. Photo has a to-one relationship to Album. Photo.album_id =>
Album.id
In my view for photo I have a selection list that''s populated with all
the available albums.
2010 Sep 01
5
validation errors bring up stack trace error page
hello!
I made some custom validations for my app, which do catch invalid data
in the console. However, when I enter invalid data through a form on the
browser view, I get your stack trace error style page (similar to what
you see when you get a syntax error or a nil object) instead of the
nicely styled error messages (what you would see in a scaffolded
application.
First off, what is the stack
2007 Feb 10
1
calling destory on HABTM clear
I know this is probably stupidly simple, but I can''t seem to figure it
out.
I have a many-to-many association using HABTM. Im trying to clear all
the stuff in the join table and call destroy on all the joined items.
For example if I have a many to many for albums and photos,
def method
album=Album.find(4)
album.photos.clear
# NOW HOW DO I DESTROY ALL THOSE PHOTOS?
end
The things I
2006 Jan 21
9
Where to put method
I''ve got following code in GenresHelper.rb
def album_list(genre)
albums = genre.albums.sort
list = albums.collect { |album| link = link_to album.title,
:controller =>
''albums'',
:action => ''show'',
2006 Aug 16
6
Photo Albums?
Hello all,
Can anyone recommend any free(ish) Ruby photo album components?
Preferably something with a user structure built in.
Cheers.
--
Posted via http://www.ruby-forum.com/.
2006 Jan 10
1
[AJAX] related drop-down list question
Hi all,
I followed the example on: http://www.roryhansen.ca/?p=9 for creating
related drop-down lists.
However, this code actually creates HTML in the controller component:
@albums = Album.find_all_by_artist_id(@params["artist_id"])
@html = "<select id=''album_id'' name=''album_id''>"
@html += "<option
2006 Jan 03
1
Passing parameters with link_to
I have following code in my controller:
class AlbumsController < ApplicationController
def list_by_year(year)
@album_pages
@albums = paginate :albums,
{ :per_page => 10,
:conditions => ["year = ?", year] }
render :action => ''list''
end
end
Now I want to make a link to the list_by_year action in
2013 May 08
1
Using koala get facebook albums photos
Hi Folks,
Good day,
I need to display my facebook album photos in my application.
I used *Koala *for facebook API.
I used this query for getting my album photos,
*current_user.facebook.get_connection("me","albums")*
by using this i can get only the albums details.
*"I need my photos which i upload in facebook "*
*
*
Please advise.
Thank you
--
You received
2008 Jun 02
3
Adviced way of tagging music
I change a lot of my CD to Ogg to be able to listen them easily from my
computer (I use foobar, I was used to WMP but it does not support library
for Ogg files and plug-ins I found for this where poor) without the need for
frequent CD changing.
I like my music to be richly tagged. But with classical music CD it is a
real pain to tag those files. Typical problems involve:
- single CD
2006 Jun 02
1
Updating html breaks my interface
I have two select menus on a line. The first updates the second:
library: library_select album: album_select
So when you pick a library, the album_select is automatically updated to
show the relevant choices. This is done using ajax. While the ajax request
is loading, I switch the album_select with a loading_select, which is a
disabled select menu with only one choice:
2006 Apr 25
6
Searching over multiple MySQL tables
I am racking my brain over this, probably because I only know very
simple mysql functions.
Basically I''ve got a few tables, ex:
Albums (id,name,band_id); Bands (id,name,label_id), and Label (id,name)
I want to search through both album.name, band.name, and label.name
throwing all results into a variable, with no redundant info.
I think what I need to be doing is setting up some
2007 May 09
1
form.select wrong number of arguments (0 for 1)
I am new to rails, PHP background. I''m completely lost on this. I am
trying to pull all of the albums from the albums table into a select
box. But every time I run the script I get the "wrong number of
arguments (0 for 1)" error. I''ve looked on other message boards and
searched the web but I can''t seem to find the answer. I''ve tried several
different
2006 Aug 11
5
Why does no one like render_component?
Maybe I''m missing the point?
Lets take for example albums of pictures. If I have a scaffold for
each, and I''m showing an album, what if I want to list all of the
pictures that are in the album?
Surely, I''d want to call the List action in the picture controller.
render_component would do this perfectly. But we''re told not to use
render_component. So
2001 Dec 07
4
album portion of the tags request
I wanted to post publicly my problem with Jonathan's proposed album
requirements. Although I do apologize, since this thread is too big already.
The idea that as a requirement one should be able to identify the exact CD
a track was ripped from is not a valid requirement in my book (not for the
tags at least), and I hope I can explain why. Without knowing the exact
way Jonathan wishes to
2008 May 10
4
Newbie: lambda do...end.should change(Model, :count).by(1). Doesn''t work
Hi to everyone,
I''m an RSpec, and BDD in general, newbie so in order to learn I have
chosen to use my personal website as a tesbed.
I''m having difficulties juggling with mocks, and in particula with the
following code.
Here''s the controller action:
def create
@album = Album.new(params[:album])
if @album.save
flash[:notice] = "album saved"
2008 Feb 11
2
Replay-gain
On Monday 11 February 2008 05:04:25 Pyt wrote:
> Can you elaborate on what you mean by "correctly use" ?
>
> On Feb 11, 2008 1:03 AM, Christopher Brown <c-b@asu.edu> wrote:
> > Is there a way to correctly use the replay-gain feature on flac files
> > that contain an entire album (i.e., multiple tracks with seekpoints added
> > from a
> > cue sheet)?