Displaying 20 results from an estimated 20000 matches similar to: "project root path helper?"
2012 Mar 20
4
Multiple Paperclip Images on Index
Hi,
I am working on a project that is using Paperclip to upload multiple
images to an Asset model. my Post model has_many Assets. As per this
tutorial/screencast...
https://github.com/Emerson/Multiple-File-Uploads-with-Paperclip-and-Rails-3/blob/master/app/views/posts/show.html.erb">
http://www.emersonlackey.com/article/paperclip-with-rails-3>
This all works fine and I can
2008 Mar 13
3
Refreshing a page gives a "stack level too deep" error.
I''m converting our app into restful rails. A couple of my classes
(Resource and Asset) have a has_many relationship with each other -
here''s the routes:
map.resources :assets, :has_many=>[:resources]
map.resources :resources, :has_many=>[:assets]
I''m getting something weird in my view pages. When i go to
/resources/4/assets
it works. I go to the page
2008 Dec 07
2
Strange 500 Error with namespace::controller#action appearing in reload only
The portion of the log linked below is two requests directly out of
the log file for the same action. The first request was from me
putting the address in the browser directly (but can be duplicated by
linking to the url anywhere in the app). When I reload the browser on
this url, I get a strange error. To the user, the action appears to
load fine, but I''m getting a 500 error in the log
2009 Jul 20
2
render :file in another window
is there a way to render a file in another window
I wrote :
def show
@asset = Asset.find(params[:id])
respond_to do |format|
format.html
format.xml { render :xml => @asset }
format.pdf {render :file => @asset.data.path }
end
end
this render in the current window....
thanks for your suggestions
erwin
2007 Nov 05
3
link_to & others really necessary?
One of the areas where I think Rails goes too far is in many of the
helpers that (AFAICT) do nothing more than change the syntax used to
write simple HTML tags. link_to and many of the form tags come to mind.
For me, these helpers aren''t that helpful. I find the HTML much
clearer to write and read, I don''t see any added value in the
overhead costs of using code to
2006 Feb 13
6
How can I access the value of params[:tags] in my validate function?
I would like to have tags mandatory in my app.
The following keeps giving me error that params is nill.
def validate()
if (@params[:tags])
errors.add(@params[:tags], ":tags must be entered ")
end
end
Why cannot I access params in my model class?
The field for tags is called "tags"
How else can I add an error using errors.add?
I
2007 Sep 25
3
Wine does not use PATH for DLL search, is this a bug or feature ?
Hi,
I test both 0.9.44 and 0.9.45 and found that Wine does not use
PATH environment variables for DLL search.
My test application is a Qt 336 application, QSlider.exe.
QSlider.exe require both qt-mt336.dll and mingwm10.dll. If I copy
both dll to ~/.wine/drive_c/windows/system32, I can invoke QSlider.exe
from anywhere and it works OK.
If I put both dlls to, eg. /opt/qt-3.3/bin. And setup
2014 Apr 26
0
jquery_ujs.js 404
I am getting this annoying error which relates to jquery_ujs.js not
being served. Any clues?
This is the site link:
http://test.kopy.com.br/home/index
GET http://test.kopy.com.br/assets/jquery_ujs.js?body=1 404 (Not Found)
index:11
GET http://ads.panoramtech.net/loader.js?client=tac
net::ERR_BLOCKED_BY_CLIENT rev.js:4
Error in event handler for (unknown): Cannot read property 'state' of
2006 May 21
6
Is there a way to call helper methods in a controller?
Hi,
Is there a way to call helper methods in a controller?
I want to do something like this in my controller
Class MyController < Action....
def my_method
string = link_to "some_url", :controller => "home", :action => "command"
end
end
link_to is an ActionView helper method and it seems that I couldn''t access
the method in the controller
2005 Dec 01
2
View helpers and nested attributes
Hello all,
I have a model with two entities (document and asset) and a 1:1
relationship defined between them (every model has an asset).
I want to generate a rthml view that generates a hash for document
attributes and a nested hash for asset attributes (for example
{:document =>{:name=>XXX :asset => {date =>XXX}})
According to the Pragmatic Programmers book (page 355), the input
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
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
2008 Aug 01
2
image_path without timestamp
Every time I use an asset tag helper, there is a parameter appended to
the end of my file name.
e.g. <input src="/images/search.gif?1213816620" type="image" />
From what I am reading, this appears to be a timestamp for caching
purposes. It works in most cases, but I want to use image_path to embed
a flash file.
.swf file in public/images/flash
e.g.
2010 Jul 22
1
Compiling the Xiph QuickTime component project in Xcode 3.2
Hello,
I've sent this question to flac-dev not realizing that QT development
belongs in ogg-dev. As it pertains more to the QT component than to
the FLAC project itself, I thought I'd repeat the question here in
hopes of some kind of suggestions or pointers. I'm basically
attempting to compile the Xiph QuickTime component project, which
fails to build. Its dependencies compile fine,
2006 Jan 17
6
link_to or helper to generate a javascript:history.back() ?
Hello,
There is an link_to option or an helper that generate a link like :
<a href="javascript:history.back()">Back</a>
Thanks
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
2011 Sep 27
1
Rails 3.1 assets path for video player Flash script 'player.swf'
I was using a Flash video player within a previous Rails version app
Moving to Rails 3.1.0 , I dob''t know where I should put the script ...
I tried to move it into an app asset sub-directory
assets
- jwplayer
- - player.swf
but this raises an error
"NetworkError: 406 Not Acceptable - http://localhost:3000/assets/jwplayer/player.swf"
player.swf
the flash script is given as a
2004 Jun 12
1
[fdo] Would you host our "immodule for Qt" project on freedesktop.org?
Hi All,
We are advancing the project "immodule for Qt." This project aims at
implementing the function similar to immodule in gtk+2.x to Qt.
For details, please refer to the following:
http://www.kde.gr.jp/~daisuke/immodule_for_qt/ImmoduleForQtDocs.html
Would you host our project on freedesktop.org?
Now, our project needs mailing list for open discussion, open repository,
bug
2005 Dec 29
0
asset host and link_to
i've defined an asset host for my Rails app and all files uploaded through
it are accessed via the asset host. How should i access the config object in
order to generate correct urls for these files using link_to?
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails
2011 Aug 31
4
Issue with asset pipeline helper with Rails 3.1 final release.
Hi, I''ve just updated my app to the final 3.1 release and deployed it to the
staging server after running tests but there is a problem with the
precompiled assets. The precompiled assets are all in the public directory,
like they were before, Capistrano doesn''t throw any error and running `rake
assets:precompile` in the current directory work as expected. But the asset