similar to: is there simpler way to export html within xml

Displaying 20 results from an estimated 8000 matches similar to: "is there simpler way to export html within xml"

2009 Apr 14
6
About haml and ruby on rail
hi all, I am converting my view into HAML format i have done it with "Html2Haml" command, then I removed all the "- end" from haml code and my indentation is also correct,but now it shows following errors I have kept code of show.html.erb and show.html.haml in attachment. please help me I am not getting what exactly the error is? compile error
2010 Sep 18
11
Commenting in an ERB without generating a compiling error
Hello, I have the following: <% @projects.each do |project| %> <tr> . <td><%= link_to ''Destroy'', project, :confirm => ''Are you sure?'', :method => :delete %></td> . </tr> <% end %> How can I safely comment out the TD line above? Do I have to use the =begin way? -- You received this message because you
2010 Nov 16
15
acts_as_taggable, undefined method 'empty?'
I''ve tried out ''acts_as_taggable'', ''acts_as_taggable_on'' and ''acts_as_taggable_on_steroids'' and all of them output "undefined method ''empty?''" with the tag_cloud action. I am following the guides precisely. Yet I can find no references to this error anywhere, so I must be doing something wrong... I am on
2009 Oct 20
10
REXML
Hi, How to embed ruby code in xml . here is my XML template : string = <<EOF <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE ozxmlscene> <ozml version="4.0"> <styleRun style="1091379" offset="0" length="7"/> <text>The End</text> <object value="84"/> <object
2010 Sep 07
2
Help on formatting some HAML
I wondered if anyone could help me with turning the following in ERB into HAML. I''m VERY new with HAML: ---- <div class="block-element span-7 colborder"> <span class="rightside blue-hue no_decor"><%= link_to "New Order", new_order_path, :remote => true %></span> <h3>Today''s Activity</h3> <hr>
2010 Oct 06
7
Passing a hash from the model to the view
I''m trying to display a drop-down menu by using an instance variable from a model. THIS WORKS... <div class="field"> <%= f.label :duration %><br /> <%= f.select ("duration", {"30 minutes" => "30", "1 hour" => "60"}, :prompt => "Select") %> </div> THIS DOESN''T
2009 Dec 23
8
Where did this value in a form come from?
Newb here. I have a form and a value that is being displayed ... and I have no idea where the value came from. I have done a <%= debugger; '''' %> in the form and, indeed, the debugger stops at the statement. I have tried to trace through the code to see where the value came from ... and I gave up. So ... what in Rails initializes the fields of a form? -- Posted via
2010 Sep 23
8
HowTo; Rails 3, having Tabs that load content via jQuery ... No Page Refesh
Hello, I''m interested in learning the correct/smart approach for implementing a web page with tabs and a content panel... When the tab is clicked by the user the tab''s content is fetched and inserted with jQuery... no page refresh... Example, Facebook, when you click Photos or Events, it doesn''t refresh the browser, just replaces the content with AJAX in the
2009 Apr 03
7
RJS not rendering correctly when mime-type is 'iphone'
I have an iPhone version of my site, and for some reason none of the rjs works when viewing the iPhone version. This happens instead: ActionView::MissingTemplate (Missing template controller_name/ update.erb in view path app/views) The rjs works fine when viewing the site normally, and it worked when viewing the iPhone version prior to upgrading Rails to 2.3.2. Additional info: I have
2010 Jan 18
8
Comment syntax and strange partial rendering
Using rails 2.3.2 I have a partial _foo.rhtml that begins with a comment as follows: <% # here is a comment %> <li><%= foo %></li> When I render the partial from a view in the traditional way, e.g. <% some_numbers = [1, 2, 3, 4, 5] %> <ul> <%= render :partial => "foo", :collection => some_numbers %> </ul> I
2010 Dec 21
5
Rails, Ruby, haml, metaprogramming problem
In HAML I have hundreds of lines like the following: - xyz = someFuncThatReturnsString(''xyz'') and elsewhere %div{''id'' => xyz} The above lines work fine. - - - Attempting to keep things DRY (Don''t repeat yourself) I want to do something like - eval(otherFuncThatReturnsString(''xyz'')) where
2010 Aug 16
8
Executing js.erb file with :format =>'js'
Hi, I''m trying to get my javascript to execute after clicking a link on my page using :format => "js" here''s my link: <%= link_to image_tag("/images/icons/user_add.png"), add_contact_path(:profile_id => profile.id, :url => request.url, :format => "js"), :title => "Add person to your contacts"%> in my controller i have
2010 Dec 21
8
Rails - escape_javascript without all the \n\n\n\n\n
Hello, I''m using escape_javascript to return a partial to the browser via ajax. Something like: $("#inject").html("<%=escape_javascript(render :partial =>"feed/ index")%>"); Problem is escape_javascript ends up outputing all kinds of wasted space like \n\n\n\n\n \n Is there anyway in Rails to escape_javascript more
2010 May 25
1
Where to start debugging
Hi, I''ve adopted a project that uses some rails features I''m not quite used to yet. (ie merb, haml) There is a snippet below. I''m not even sure what other part of the code to include to help with this. I''m open to suggestions :) $ merb ... ... ... ~ Compiling routes... app/views/stretches/show.html.haml:87:in `send'': compile error (SyntaxError)
2010 Dec 06
8
How to add facebook javascript sdk to rails app
Hey, i''m trying to add the facebook javascript SDK to my rails app. How do i do that in the application.html.erb file? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To
2008 Dec 19
14
Can duplicate "back" browser function in Rails?
In Rails I have a DB Table index.html.erb view. It has 100''s of items. When I gen via scaffold I get index, show, edit, update, etc view. But when I page down several pages, use the "show" link and then the "back" link I do not go back to where I was on the index view. Instead, I go back to the TOP of the index not the place where I clicked on the "show"
2011 Jan 20
4
Comment.all returns array of what?
I have a bad feeling asking this but I did not manage to find an answer myself :/ @comments = Comment.all @comments is an array. I can for example access comment.created_at directly, or I could do: <% @comments.each do |comment| %> <%= debug comment["created_at"] %> <% end %> I expected comment to be a hash, but comment.keys or comment.values fail, as well as an
2010 Jan 15
21
Dynamic Assets - can it be done?
I''m looking for 3 areas to work as dynamic assets: image_path, javascript_path, and stylesheet_path When I say dynamic, I mean that they will be dynamic through controller/models. I have been working through approx. 12 hours of searches to satisfy my answer to this question but am not finding much luck. The closest things I''ve found enabling this are use of config for assets
2011 Jan 26
13
undefined method `model_name' for NilClass:Class
I am new to Ruby on Rails and have a very simple foreign key example that is driving me nuts. I am using Rails 3 under Windows Vista and have two tables: users and user_comments. user_comments.user_id should point to the user a comment is about. In my show view for user I have a link to the new method of user_comments to allow a comment to be created. This throws: Showing
2010 Oct 19
33
Render partial generate unwanted spaces
Hello, I have a problem with the render :partial method in all my rails webapplications. I noticed that using render :partial will generate spaces (mainly top spaces) on the elements inserted. As all my websites are seperated by module (basicaly header, content, menu, footer) it''s quite a problem as I have to set negative margin- top to various parts for the site to display as expected