Hi All,
I'm trying to use permalink_fu with globalize3.
I have
has_permalink :name
translate :name
The problem is that it doesn't keep my permalinks unicity,
If I create a Product named "Test" and then another one named "Test", they both will have the permalink "test" (the first should be 'test' and the 2nd should be 'test-2')..
...
Hi,
I have trouble getting started with rails 3.0.0, because it just doesn't load the rake tasks
rake gems:install
rake aborted!
Don't know how to build task 'gems:install'
rake -T
rake about # List versions of all Rails frameworks and the environment
rake db:create # Create the database from config/database.ym...
I am trying to create a scope on a model of mine limiting the available results to only those that are owned by the user's partner. When the user is an administrator, however, I want all models to be available.
This works, but looks stupid. What is the proper rails3 way of expressing this?
scope :accessible_by, proc { |user|
if user.a...
I installed rails 3 with rspec 2, but when i run controller generator it creates rspec tests only for controller helpers and does not create them for controller itself.
...
I am trying to look into setting up an OAuth Provider Server with Rails 3 but can't seem to find anything out there to accomplish this.
I am also a newb when it comes to oauth, so excuse my ignorance.
When setting up an oauth server do I need to already have an oauth account at somewhere like agree2.com? Or can I just use my own serve...
In a rails console, it can be done this way:
ree-1.8.7-2010.02 > helper.number_to_human_size 1
=> "1 Byte"
ree-1.8.7-2010.02 > helper.number_to_human_size 100000
=> "97.7 KB"
ree-1.8.7-2010.02 > helper.number_to_human_size 0
=> "0 Bytes"
ree-1.8.7-2010.02 > helper.number_to_human_size 100000000
=> "95.4 MB"
but what about in a...
I have some static pages in a navigation menu. I want to add a class like "current" to the item which is currently displaying.
The way I am doing so is to add tons of helper methods (each for one item) to check the controller and action.
def current_root_class
'class="current"' if controller_name == "homepage" && action_name == "inde...
The new rails routes are great in many aspects, but I am looking for the best way to achieve page caching with pages and formats like I had in rails 2.x and am coming up short
I have many possible desired routes of the basic formulas:
/(bazes/<baz id>/)(foos/<foo id>/)bars/page/<page num>/<format>
Example routes:
/bars/page/1/xml
/f...
I am using remote form in Rails 3. It works fine but I want to show / hide spinner during ajax request.
In rails 2.3.* we use :before & :after in remote form to show/hide spinner
What should I do in Rails 3, as remote form of Rails 3 doesn't contain such options.
...
Hi,
to clarify: there's only one rails command, which gets installed from the latest Rails gem, which is Rails 3 ATM. However, I'm required to create a Rails 2.3 app.
Running ruby /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.8/bin/rails fails with a NoMethodError, I suppose because it also tries to use gems from the 3.0.0 release.
Unin...
Hello - We are trying to implement a functionality in our ROR application such that we are able to drag and drop rows between different tables. We tried using Scriptaculous Drag and Drop method but it does not works inside the table tags.
Can you point us to other alternatives like JQuery etc which might be useful.
Thanks
Supreet
...
Hi there,
I've noticed that in my new Rails 3.0 application all German i18n strings are converted to lowercase (except for the first letter).
When having a string like this:
de:
email: "E-Mail"
the output is always like "E-mail". Same story with all the other strings - uppercase letters within a sentence are auto-converted to lowe...
I'm having a hard time getting a simple file upload test working. I'm using Rails 3.0.0 on ruby 1.9.2 with Cucumber and Capybara.
View:
<%= form_tag "/upload/create", :multipart => true do %>
<label for="file">File to Upload:</label>
<%= file_field_tag "file" %>
<%= submit_tag "Upload" %>
<% end %>
Cucumber Step:
When /^I upl...
Hi guys,
I want Rails to inject different js files in development and production modes.
Example:
Development:
<script src="/javascripts/jquery.js" type="text/javascript"></script>
<script src="/javascripts/myscripts.js" type="text/javascript"></script>
Production:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jque...
Hello... Currently I'm using Devise & CanCan which allows me to create
Users with Roles using a (Roles_Users) table.
That's nice, but what I want is to Have Projects in my app and for
each project for a user to possibly have a role like (Admin, Viewer,
etc) IE, roles are not assigned to users but to users based on what projects the...
I have a rails 2.3.5 app getting upgraded to Rails 3. I did every thing I am required to do for upgrading and when I start the rails server using
rails server
it gives me this
Please switch to Ruby 1.9's standard CSV library. It's FasterCSV plus
support for Ruby 1.9's m17n encoding engine.
I am using ruby-1.9.2-p0 and have faster...
Here's my code I'm spec'ing:
def vote_up
get_vote
@vote.value += 1 unless @vote.value == 1
@vote.save
respond_to do |format|
format.js { render :action => "vote", :layout => false }
end
end
Seems pretty straightforward. This is what I'm trying to spec it with :
it "should vote up" do
@mock_cat = Factory.create(:ca...
Hi guys,
I'd like to use javascript_include_tag to grab all view related scripts using recursion, which a placed in public/javascripts/views.
I'm trying javascript_include_tag "/views", :recursive => true, but failed to add any script.
Regards,
Alexey Zakharov
...
Before Rails 3 I used to set a title instance variable in my controller actions and then use <%=@title%> in my layouts.
But in Rails 3 they have included a helper method
def title(page_title)
@content_for_title = page_title.to_s
end
and in the application.html erb
<title><%= yield(:title) %></title>
This requires us ...
Hi, since i migrated to rails 3.0, logs are now filled with queries like this:
SQL (8.5ms) SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull
FROM pg_attribute a LEFT JOIN pg_attrdef d
ON a.attrelid = d.adrelid AND a.attnum = d.adnum
WHERE a.attrelid = '"checkins"'::regclass
AND a.attnum > 0 AND NOT a.a...