Wordpress themes are beautiful!
Is there any guideline to use Wordpress themes in a rails app? Even better, are there rails app templates which can use the Wordpress themes already?
Thanks!
In Rails, is there a way to display different error messages on a production rails server (a nice graphic) vs a development server (detailed error information, stack trace, etc.)?
I know named_scope has been changed to scope in rails 3.
How do I perform default_scope in rails 3, I've had a good google but found nothing for defaults scopes.
How do we monitor that the connectivity between the rails app and the database is established. will rails try to re-connect the connection with mysql if it closes?
I would like to find some help building a tree interface in Rails. I've tried using jsTree but am having trouble integrating it properly into Rails.
Thanks.
Its not the another language debate, its a decision making discussion.
I am a ASP.NET developer, but want to learn other frameworks/language (open source). I don't know from where i should start and why? Django and Rails both seems promising, but i am confused which one i should choose to start, or i should choose some other framework. I know learning the language (python or ruby) is must before start Django or Rails.
Please advise.
using the delcarative_authorization gem for rails, is there a shortcut to allow a role access to all controller actions?
privileges do
# default privilege hierarchies to facilitate RESTful Rails apps
privilege :manage, :includes => [:create, :read, :update, :delete]
end
isn't sufficient, because I have more controlling methods than just CRUD in my controllers.
Something like:
role :foo do
has_permission_on :bar, :to =>[:all]
end
would be perfect, but I'm not finding it in the docs.
I have a rails application that allows searches using longitude and latitude. I have added a 'pretty' route with:
map.connect 'stores/near/:longitude/:latitude', :controller => 'stores', :action => 'index'
This works for integer latitude and longitude values (http://localhost:3000/stores/near/-88/49) but fails for decimal values (http://localhost:3000/stores/near/-88.341/49.123) giving:
Routing Error
No route matches "/stores/near/-88/49.0" with {:method=>:get}
Any ideas how to use pretty URLs in rails with decimals?
Ruby onRails is maybe the most praised web development framework exist. There are tons of reasons for that, but every framework, even the best of its kind, has its drawbacks.
I'd like to know the most common problems you run into when developing Ruby onRails applications and the issues you often struggle with.
I wrote my first Rails 3 app and it ran absolutely fine in development mode. Now I deployed it on my server and wanted to start it in production mode. The app starts but none of my images or stylesheets are being loaded. The Rails console outputs a lot of RoutingErrors to those files. Isn't that mode available yet?
In a blog in Rails I want to have paths like
http://mydomain.com/posts/28383/comments#21
This is the 21st comment of the 28383th post. The 21 is not an unique id, but the pair 28383, #21 is unique.
How can I do this in Rails? Do I have to change the routes? the model?
I will be very thankful if you can point me in the right direction
Thanks
What happened to asset_host in rails 3?
Earlier I can put following code into development.rb and get all assets not present on development:
ActionController::Base.asset_host = proc do |source, request|
unless File.exist?(File.join(RAILS_ROOT, 'public', source.sub(/\?\d+$/, '')))
'http://example.com'
end
end
But in rails 3 there is no such method and google does not help me.
I've noticed that the Rails log correctly displays the time taken to execute an action in the logs, and that the View: part of that is also rendered correctly. However, the DB: value is always zero:
Aug 11 13:00:22 [2326] INFO: Completed in 2072ms (View: 94, DB: 0) | 200 OK
In fact, all my DB timings are being logged as zero. I'm logging at DEBUG level, in development mode, running Rails 2.3.2.
Apologies in advance if the answer is blatantly obvious.
Hi guys,
I'm developing JAX-RS application and it's working fine. Now, i want to develop web service client application using Rails. And my question is which is the best way to parsing RESTfull webservice's response in Rails?
I have an Rails application with SayController, hello action and view template say/hello.html.erb. When I add some cyrillic character like "?", I get an error:
ArgumentError in SayController#hello
invalid byte sequence in UTF-8
Headers:
{"Cache-Control"=>"no-cache",
"X-Runtime"=>"11",
"Content-Type"=>"text/html; charset=utf-8"}
I use Windows 7 x64, Ruby 1.9.1p378, Rails 2.3.5, WEBrick server.
Hello, I'm looking for any pointers on how to write a rails web app without ActiveRecord.
A doc or an example of a (not too complex) web app using storage backends other than a relational database would be greatly appreciated.
It's not clear on what should be implemented in the model classes in order to make the rails app work without the ActiveRecord layer.
Thanks,
hi all,
I am trying to install ruby onrails in my own intranet, I don't have an internet connection. There are several tutorials out there that try to explain how to do so, but they don't seem to work. Does anyone know of a full installation (including ruby, rails, IDE) that doesn't demand downloading files from the internet?
Thanks alot!
I want to be able to edit and delete resources myself, but not allow users of the application to do so.
Is there an easy way of doing this in Rails?
An incomplete solution would be just to remove the "delete" and "edit" buttons from the index view, but that doesn't disable their ability to do so via direct HTTP requests.
Running Rails 2.2.2 and ruby 1.8.7
I'd like to build a webapp in Rails in which I'd like to determine every pixel's color of a given image (JPEG). Is there any possibility to do that with Rails or JavaScript? The goal is to write an algorithm which determines the "middle color" of the image and uses it for background color of the site.
Any suggestion would be appreciated.
In Rails 2 we can add custom new actions to resourceful routes, like:
map.resources :users, :new => {:apply => :get}
How do we achieve the same thing in Rails 3?
resources :users do
get :apply, :on => :new # does not work
new do
get :apply # also does not work
end
end
Any ideas?
Is it possible to start an AMQP subscriber with my Rails app? Possibly through an initializer or something.
I'd like to have it running at the same time that can also interact with Rails models. Below is a pseudo-code example of what I mean.
queue.subscribe do |msg,body|
Foo.create(....)
end
I saw this post but mine is slightly different:
http://stackoverflow.com/questions/1559879/rails-actionmailer-with-multiple-smtp-servers
I am allowing the users to send mail using their own SMTP credentials so it actually does come from them.
But they will be sent from the Rails app, so that means for each user I need to send their emails using their own SMTP server.
How can I do that?
Is there a way to start a Rails 3 development server (rails server) that is not bound to a specific IP address? I'd like for others working on a project with me to be able to use the application from remote locations.
I have ruby onrails installed on my ubuntu 8.10 desktop. Script/generate came up with this error.
# script/generate
undefined method `index' for #<Enumerator: "Rails Info:":each_line>
any ideas?
Thanks for you help,
zeem
I have a requirement where in I want to redirect to an external Url
Here is my code
in routes.rb
map.connect "/myapp/:someparam" ,
:controller = "foocontroller" ,
:action = "redirect_to_external_url"
In my foo controller i have this action
def redirect_to_external_url
redirect_to "http://externalurl.com/#{params[:someparam]}.html"
end
which will redirect to the external url
The problem That I am facing is
After redirecting, The browser shows "http://externalurl.com/bar.html whereas I want the browser to show "/myapp/bar" url (ex http://mydomain.com/myapp/bar) for seo purpose.
Any idea on how this can be achieved in rails ?
The Rails version that I am using is 2.3.4