Is there any way to use text messages to CRUD data in a Rails app? For instance, a user would send a text message to a specific number and the Rails app could use that data in any way. Just wondering if there's a solution out there.
...
im trying to backup my ruby on rails instance as a zip file with yaml files and other attachments in a zip folder. How can i do this?
...
I'm a beginner to Ruby/Rails, and just generated my first HTML programmatically - kind of exciting-- but when I viewed "page source" from the browser, my HTML had all these additional gaps and messed up the logical indentation:
This code in a View:
<% @states_array.each do |state| %>
<ul><%= state %></ul>
<% end %>
and this code in...
Hi,
Is there a way to specify and OR condition?
For example:
Message.find(1, :condition => {"profile_id = ? OR sender_id = ?", 2, 2})
Ultimately, I want to check whether a user has sent or received a message, but if I do them separate I an exception is thrown when the record is not found for one of the cases.
...
I'm using basic scaffold structure. What I need, is to add 'moderate' action and view by changing published to true. In my idea, on moderate.html I should get the list of all unpublished entries with the ability to change and save their parameters.
Here are parts of my code:
#names_controller.rb
def moderate
@name = Name.find(:all, :...
I'm using Rack middleware that accepts some configuration that I need to change at run time. So I need the instance of its class that's currently in memory. Is there a way to do obtain it?
...
I just tried to deploy to Heroku and got a 500 server error.
heroku logs:
Started GET "/" for ##.##.###.### at 2010-10-14 17:59:34 -0700
Processing by WelcomeController#index as HTML
Rendered welcome/index.html.erb within layouts/index (2.3ms)
Completed in 3ms
ActionView::Template::Error (can't convert nil into String):
5: <...
Let's say I have the following XML :
<links>
<item>
<title>Title 1</title>
<url>http://www.example.com/url-1</url>
</item>
<item>
<title>Title 2</title>
<url>http://www.example.com/url-2</url>
</item>
<item>
<title>Title 3</title>
<url>http://www.example.com/url-3</url>
</item>
</l...
Hello, at some point after I installed Ruby on rails, my terminal on Snow Leopard began executing the configuration (?) procedure for Ruby.
Last login: Thu Oct 14 21:39:51 on ttys002
/Users/Adam/.rvm/rubies/ruby-1.9.2-p0, this may take a while depending on your cpu(s)...
ruby-1.9.2-p0 - #fetching
ruby-1.9.2-p0 - #extracted to /Users/A...
I'm creating a basic blog application and I'm running into issues displaying error messages when a user tries to submit a blank comment. Instead of getting a nice looking error message, an active record error message with the correct validation erorrs. Such as
ActiveRecord::RecordInvalid in CommentsController#create
Validation ...
For example:
class Tree
has_many :apples
end
class Apple
belongs_to :tree
end
class ApplePresenter
presents :apple
def name
@apple.name.upcase
end
end
class TreePresenter
presents :tree
def apples
present_collection @tree.apples
end
end
Using this, there's no need to duplicate the ApplePresenter methods a...
Given a particular model, is there a way to see and edit existing validations?
I'm writing a plugin and I need to modify a validation if it exists.
For example:
If I have a User model with validate_uniqueness_of :ssn
This model is using the plugin so I need to modify that validation and
add an :if or a :scope, etc.
So basically if ...
I'm runnng Rails 2.3.8.
I set up map.resources :users in my routes.rb file.
When I run rake routes it shows:
users GET /users(.:format) {:action=>"index", :controller=>"users"}
GET /users(.:format) {:action=>"index", :controller=>"users"}
new_user GET /users/new(.:format) {:action=>"in...
I'm working on a social networking application and am trying to build
a complex query that efficiently pulls all of a users' friends'
checkins from the database. Basically I need: "user.friends.checkins"
I've recreated (in simplified form) the data structure below for
reference and included several solutions I've found, however I feel
...
please suggest me a gem or way validation embed video by ruby code. Example: Youtube Video, Google Video.
...
Does using a hidden fields on a form allow for the possibility of someone spoofing the data in the hidden fields that are posted back?
For instance, in my Rials app I have parent-child structure where I call new_project_task(@project) which hits the tasks controller create action, and on the page I do not want to show a field for the f...
I have installed RedCloth, by using the devkit. Using gem install RedCloth.
If I use plain irb, then require 'RedCloth' works fine.
But if I use rails console and do require 'RedCloth', it says it can't find file to load.
Please help.
Rails 3.0.0
RedCloth 4.2.3
...
I just switched over from my development database to the production database, and I realized I'm getting a consistent error nomatter what view I try to open. The stylesheets are not loading correctly, despite being in the correct place.
Here's some information about the error:
View
<head>
<%= stylesheet_link_tag "global", "home", "htt...
Hi,
I am following the railstutorial.org tutorial. While I am able to see the gravatar on the webpage, my rspec test is failing.
Here is the user_controller_spec.rb test:
describe "GET 'show'" do
before(:each) do
@user = Factory(:user)
end
it "should be successful" do
get :show, :id => @user
response.should be_suc...
Bundler is breaking my resourceful route!
To confirm I created a clean rails app (2.3.4) and made a users scaffold.
map.resources :users creates the following:
users GET /users(.:format) {:controller=>"users", :action=>"index"}
POST /users(.:format) {:controller=>"users", :action...